Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Commit

Permalink
Update pings & switch them
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Ray committed Sep 26, 2018
1 parent a1995e0 commit 1cebe40
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
47 changes: 32 additions & 15 deletions commands/eping.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
const Discord = require("discord.js");
const talkedRecently = new Set();
exports.run = async (client, message) => {
const msg = await message.channel.send("Ping...");

msg.edit(`Ping! \`${msg.createdTimestamp - message.createdTimestamp}ms\``)
if (talkedRecently.has(message.author.id) && !message.member.roles.has("490364533550874644")) {

message.channel.send("You are being rate limited!" + message.author);
} else { // eslint-disable-line no-unused-vars
const msg = await message.channel.send("Ping?");
const embed = new Discord.RichEmbed()
.setAuthor(`${client.user.username}`, `${client.user.avatarURL}`)
.setColor(message.member.displayColor)
.addField("• Ping Latency", `${msg.createdTimestamp - message.createdTimestamp}ms`, true)
.addField("• API Latency", `${Math.round(client.ping)}ms`, true)
.setFooter(`${client.user.username} | Beta - Master`);
msg.edit(embed);
talkedRecently.add(message.author.id);
setTimeout(() => {
// Removes the user from the set after a minute
talkedRecently.delete(message.author.id);
}, 2000);
};
}

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Standard User"
};
exports.help = {
name: "eping",
category: "Misc",
description: "Pings the bot, without the embed.",
usage: "eping"
};
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Standard User"
};

exports.help = {
name: "ping",
category: "Misc",
description: "Pings the bot, responds with API and regular latencies.",
usage: "ping"
};
47 changes: 15 additions & 32 deletions commands/ping.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,19 @@
const Discord = require("discord.js");
const talkedRecently = new Set();
exports.run = async (client, message) => {
if (talkedRecently.has(message.author.id) && !message.member.roles.has("490364533550874644")) {

message.channel.send("You are being rate limited!" + message.author);
} else { // eslint-disable-line no-unused-vars
const msg = await message.channel.send("Ping?");
const embed = new Discord.RichEmbed()
.setAuthor(`${client.user.username}`, `${client.user.avatarURL}`)
.setColor(message.member.displayColor)
.addField("• Ping Latency", `${msg.createdTimestamp - message.createdTimestamp}ms`, true)
.addField("• API Latency", `${Math.round(client.ping)}ms`, true)
.setFooter(`${client.user.username} | Beta - Master`);
msg.edit(embed);
talkedRecently.add(message.author.id);
setTimeout(() => {
// Removes the user from the set after a minute
talkedRecently.delete(message.author.id);
}, 2000);
};
const msg = await message.channel.send("Ping...");

msg.edit(`🏓 Pong! \`${msg.createdTimestamp - message.createdTimestamp}ms\``)
}

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Standard User"
};

exports.help = {
name: "ping",
category: "Misc",
description: "Pings the bot, responds with API and regular latencies.",
usage: "ping"
};
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Standard User"
};
exports.help = {
name: "ping",
category: "Misc",
description: "Pings the bot, without the embed.",
usage: "ping"
};

0 comments on commit 1cebe40

Please sign in to comment.