-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Simple ping command #858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple ping command #858
Conversation
Use camelCase please. |
embed1, embed, ect. Is uninformative. |
Please check for mismatched parentheses and scopes, seems there's a few syntax errors too. |
dunno how to suggest edits to a commit, or if that is even possible so I'll just put this here: const SlashCommand = require("../../lib/SlashCommand");
const { MessageEmbed } = require("discord.js");
const command = new SlashCommand()
.setName("ping")
.setDescription("View the bot's latency")
.setRun(async (client, interaction, options) => {
let msg = await interaction.reply({
embeds: [new MessageEmbed()
.setDescription("🏓 | Fetching ping...")
.setColor("#6F8FAF")
]
})
let zap = "⚡"
let green = "🟢"
let red = "🔴"
let yellow = "🟡"
var latState = zap;
var apiState = zap;
let apiPing = Math.round(client.ws.latPing)
let latPing = `${Date.now() - msg.createdTimestamp}`
const uptimeCount = moment.duration(client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
if (apiPing >= 40 && apiPing < 200) {
apiState = green;
} else if (apiPing >= 200 && apiPing < 400) {
apiState = yellow;
} else if (apiPing >= 400) {
apiState = red;
}
if (latPing >= 40 && latPing < 200) {
latState = green;
} else if (latPing >= 200 && latPing < 400) {
latState = yellow;
} else if (latPing >= 400) {
latState = red;
}
msg.edit({
embeds: [new MessageEmbed()
.setTitle("🏓 | Pong!")
.addField("API Latency", `${apiState} | ${apiPing}ms`, true)
.addField("Message Latency", `${latState} | ${latPing}ms`, true)
.addField("Uptime", `⏲️ | ${uptimeCount}`, true)
.setColor("#6F8FAF")
.setFooter({
text: `Requested by ${interaction.user.username}`,
iconURL: (message.author.avatarURL())
})
]
})
}); |
This shouldn't happen, @XstreamSpeed Please check your commit / changes first before making a pull request. |
Yeah, all of my recent pull requests are not tested. I don't have much time to do so, I'm preparing for 10th rn. |
this is music bot, why does this needed? |
That's what I said |
Then don't make those pull request(s), stop wasting maintainers time. If you want to contribute to FOSS. Test 👏🏼 your 👏🏼 commit 👏🏼 first 👏🏼 before 👏🏼 making 👏🏼 a 👏🏼 pull 👏🏼 request. |
I'm just going to close this. |
Alright dawg |
Please describe the changes this PR makes and why it should be merged:
Simple ping command that every bot should have
Status and versioning classification:
Nodejs v17.8.0