-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
40 lines (34 loc) · 1.4 KB
/
main.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
36
37
38
39
40
const { prefix, token } = require('./config.json')
const { Client, Intents } = require('discord.js');
const bot = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
const request = require('request');
bot.on('ready', () => {
console.log(' ');
console.log('------------------------------------------------------');
console.log('Example Discord bot developed by @washedgram');
console.log(' ');
console.log(`You are now logged in as ${bot.user.tag} ...`);
console.log(' ');
console.log('Closing this Terminal/CMD window will disconnect the bot from your server.');
console.log('------------------------------------------------------');
console.log(' ');
bot.user.setActivity('developed by @washedgram')
});
bot.login(token);
bot.on('message', msg => {
if (msg.content.toLowerCase() === `${prefix}embed`) {
msg.channel.send( { embed: {
color: 2123412,
fields: [{
name: "This is an embedded message",
value: "Put something else here!"
}
],
footer: {
icon_url: bot.user.avatarURL,
text: 'Discord bot v.1.0 | @washedgram'
}
}});}
else if (msg.content.toLowerCase() === `${prefix}help`) {
msg.channel.send('this is a normal message.\nType !embed to see an embedded message');
}})