Frequently Asked Questions
Some very quick code samples for common actions on the bot, users, members, channels and messages!
In this page, some very basic, frequently-asked questions are answered. It's important to understand that these examples are generic and will most likely not work if you just copy/paste them in your code. You need to understand these lines, not just blindly shove them in your code.
Code Examples
Bot and Bot Client
// Set the bot's "Playing: " status (must be in an event!)
client.on("ready", () => {
client.user.setActivity("my code", { type: "WATCHING"})
})// Set the bot's online/idle/dnd/invisible status
client.on("ready", () => {
client.user.setStatus("online");
});// Set the bot's presence (activity and status)
client.on("ready", () => {
client.user.setPresence({
activities: [{
name: "my code",
type: "WATCHING"
}],
status: "idle"
})
})Note: You can find a list of all possible activity types here.
Users and Members
Channels and Guilds
Messages
Last updated