generated from Aayush-683/Tutorial-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
30 lines (25 loc) · 946 Bytes
/
server.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
const Discord = require('discord.js');
const bot = new Discord.Client();
const config = require("./config.json");
bot.once('ready', () => {
bot.user.setActivity(`Custom Status Here`, { type: "WATCHING"})
console.log('Online');
});
bot.on('message', async (message) => {
let prefix = config.prefix
const [cmd, ...args] = message.content.split(/\s/)
if (cmd === prefix + 'hello') {
message.channel.send('Yes, Hi im on!!!');
}
if(message.content.startsWith(prefix + 'test')){
const embed1 = new Discord.MessageEmbed()
.setTitle('test embed')
.setDescription('some important text')
.addField('Github-repo', '**[Click here](https://github.com/BlackKnight683/Discord-Bot-Template)**')
.setFooter('Made by oofy')
.setColor('RED')
await message.channel.send(embed1); //The embed1 or whatever variable you put in const embed1 must go in the (embed1) spot.
}
}
)
bot.login(config.token);