Skip to content

Commit 1caef32

Browse files
authored
Merge pull request #11 from Drabblesaur/master
Lol im tried
2 parents c67b764 + b6d4e6f commit 1caef32

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

index.js

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,39 @@ require('dotenv').config();
55

66
const RoboCommands = (msg) => ({
77
"website": () => msg.reply('https://www.da-developers.dev'),
8-
"bot info": () => msg.reply('Version 1.0.1'),
8+
"bot info": () => msg.reply('Version 1.0.1'),
99
"hits vape": () => msg.reply('🥬💨'),
1010
"YEET": () => msg.reply('YOTE'),
1111
"ping": () => msg.reply('🏓pong')
1212
});
1313

14+
const TonyCommands = (msg) => ({
15+
"lead": () => msg.reply('👌 You are a Leadership Member')
16+
});
17+
1418
/**
1519
* Handles incoming messages for Robo
1620
*/
1721
const handleMessage = (msg) => {
1822
const PREFIX = 'DG!';
23+
const TonyKey = 'Tony=>'
1924
const msgs = msg.content.split(" ")
2025
const roboCommands = RoboCommands(msg);
26+
let role = msg.member.guild.roles.find('name', 'Leadership')
2127
if (msgs[0] == PREFIX) {
2228
// getting rid of DG! prefix
2329
msgs.splice(0, 1);
30+
if (msgs[0] == TonyKey) {
31+
if (msgs.length === 0 || msgs == undefined) {
32+
msg.reply('At least one argument is needed to complete a task.');
33+
} else {
34+
if (TonyCommands[msgs.join(" ")]) {
35+
TonyCommands[msgs.join(" ")]();
36+
} else {
37+
msg.reply('The command you entered is could not be found.')
38+
}
39+
}
40+
}
2441
if (msgs.length === 0 || msgs == undefined) {
2542
msg.reply('At least one argument is needed to complete a task.');
2643
} else {
@@ -45,13 +62,13 @@ bot.on('guildMemberAdd', member => {
4562
channel.send(`Welcome to the server, ${member} be sure to read #rules 👋`);
4663
});
4764

48-
bot.on('message', message =>{
49-
if(message.channel.name == 'rules'){
50-
let role = message.member.guild.roles.find('name','Unapproved');
51-
message.member.removeRole(role);
52-
message.delete(0)
53-
.then(msg => console.log(`Deleted message from ${msg.author.username}`))
54-
.catch(console.error);
65+
bot.on('message', message => {
66+
if (message.channel.name == 'rules') {
67+
let role = message.member.guild.roles.find('name', 'Unapproved');
68+
message.member.removeRole(role);
69+
message.delete(0)
70+
.then(msg => console.log(`Deleted message from ${msg.author.username}`))
71+
.catch(console.error);
5572
}
5673
});
5774

0 commit comments

Comments
 (0)