forked from projectdysnomia/dysnomia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
intent.js
35 lines (28 loc) · 969 Bytes
/
intent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const Dysnomia = require("@projectdysnomia/dysnomia");
// Replace TOKEN with your bot account's token
const bot = new Dysnomia.Client("Bot TOKEN", {
gateway: {
intents: [
"guilds",
"guildMessages"
]
}
});
bot.on("ready", () => { // When the bot is ready
console.log("Ready!"); // Log "Ready!"
});
bot.on("error", (err) => {
console.error(err); // or your preferred logger
});
bot.on("guildCreate", (guild) => { // When the client joins a new guild
console.log(`New guild: ${guild.name}`);
});
bot.on("messageCreate", (msg) => { // When a message is created
console.log(`New message: ${msg.cleanContent}`);
});
// This event will never fire since the client did
// not specify `guildMessageTyping` intent
bot.on("typingStart", (channel, user) => { // When a user starts typing
console.log(`${user.username} is typing in ${channel.name}`);
});
bot.connect(); // Get the bot to connect to Discord