-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
62 lines (58 loc) · 3.68 KB
/
app.js
File metadata and controls
62 lines (58 loc) · 3.68 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const Discord = require('discord.js');
const bot = new Discord.Client();
const config = require('./settings.json');
bot.on('ready', () => {
console.log(`=============================\n\nClient Username: ${bot.user.username}\nClient ID: ${bot.user.id}\nBot Owner: ${bot.users.get(config.ownerID).username}\nBot Prefix: ${config.prefix}\nBot Default Command: ${config.prefix}help\nBot Current Version: 1.0.1\n\n=============================`)
})
bot.on('message', netent => {
let args = netent.content.split(' ').slice(1);
if(netent.content.startsWith(config.prefix + 'ping')) {
netent.channel.send(`**Done pinging! The Roundtrip took about __${Math.round(bot.ping)}__ ms ! :ping_pong:**`)
} else
if(netent.content.startsWith(config.prefix + 'setgame')) {
let game = args.join(' ');
if(netent.author.id !== config.ownerID)
return netent.channel.send(`**You don't have the correct Access Rights! :no_entry_sign:**`);
bot.user.setGame(game).then(() => netent.channel.send(`**Changed my game to ${game}!**`));
} else
if(netent.content.startsWith(config.prefix + 'help')) {
netent.channel.send(`__${netent.author.username}__: Check your DMS!\nDo \`\n${config.prefix}invite\`\ to get my Invite!`).then(() => netent.author.send(`**\`\`\`\<====> -Help Message Page 1- <====>\n\n${config.prefix}ping - Ping!\n${config.prefix}help - Shows this message!\n${config.prefix}kick - Kicks a Specified User with a Reason!\n${config.prefix}ban - Bans a Specified User with a Reason!\`\`\`\n${bot.user.username} was made in the Discord.js Library!\nOur Support Server Invite: https://discord.gg/9KAZxHM**`));
} else
if(netent.content.startsWith(config.prefix + 'kick')) {
let user = netent.mentions.users.first();
let reason = args.slice(1).join(' ');
var member = netent.guild.member(user);
if(!netent.member.hasPermission('KICK_MEMBERS'))
return netent.channel.send(`**Access Denied! :no_entry_sign:\nMissing the Permissions \`\Kick Members\`\**`);
if(!user)
return netent.channel.send(`**Please specify a User!**`);
if(!reason)
return netent.channel.send(`**Please apply a Reason for the Kick!**`)
netent.channel.send(`**\`\`\`\Kicked User ${user.tag},\nResponsible for the Kick: ${netent.author.tag}\nReason: ${reason}\`\`\`\**`)
member.kick()
} else
if(netent.content.startsWith(config.prefix + 'ban')) {
var user = netent.mentions.users.first();
if(!netent.member.hasPermission('BAN_MEMBERS'))
return netent.channel.send(`**Access Denied! :no_entry_sign:\nMissing the Permissions \`\Ban Members\`\**`);
if(!user)
return netent.channel.send(`**Please specify a User!**`);
if(!reason)
return netent.channel.send(`**Please apply a Reason for the Ban!**`)
netent.channel.send(`**Banned User ${user.tag}, well it was about time!\nResponsible for the Ban: ${netent.author.tag}\nReason: ${reason}**`)
member.ban()
} else
if(netent.content.startsWith(config.prefix + 'shutdown')) {
if(netent.author.id !== config.ownerID)
return netent.channel.send(`**You don't have the correct Access Rights! :no_entry_sign:**`);
netent.channel.send(`**Shutdown was triggered!\nShutting down... :wave:**`).then(() => bot.user.setStatus('invisible').then(() => process.exit(0)));
} else
if(netent.content.startsWith(config.prefix + 'invite')) {
netent.author.send(`**Here\'s my invite!\n=> https://discordapp.com/oauth2/authorize?client_id=${bot.user.id}&scope=bot&permissions=1043472446**`)
}
});
bot.login(config.token);
// Bot = The Bot
// User = User being mentioned
// Author = You!
// Netent = the Message