summaryrefslogtreecommitdiff
path: root/bot.js
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-11 20:57:47 -0700
committer8cy <[email protected]>2020-04-11 20:57:47 -0700
commit6295d78afbfee11441dbd425cea6636e38049e86 (patch)
tree83a8351a6aaa70e9720fe14eb0062e2824b86db9 /bot.js
parentfix server command, v2.1.2 (diff)
downloads5nical-6295d78afbfee11441dbd425cea6636e38049e86.tar.xz
s5nical-6295d78afbfee11441dbd425cea6636e38049e86.zip
add sharding + help stuff, v3.0.0
- add sharding - add examples - change up command aliases - formatting
Diffstat (limited to 'bot.js')
-rw-r--r--bot.js70
1 files changed, 70 insertions, 0 deletions
diff --git a/bot.js b/bot.js
new file mode 100644
index 0000000..c587677
--- /dev/null
+++ b/bot.js
@@ -0,0 +1,70 @@
+const config = require('./config.json');
+const { CommandoClient } = require('discord.js-commando');
+const path = require('path');
+const { Structures } = require('discord.js');
+Structures.extend('Guild', Guild => {
+ class MusicGuild extends Guild {
+ constructor(client, data) {
+ super(client, data);
+ this.musicData = {
+ queue: [],
+ isPlaying: false,
+ volume: 1,
+ songDispatcher: null
+ };
+ }
+ }
+ return MusicGuild;
+});
+
+const client = new CommandoClient({
+ commandPrefix: 's5n!',
+ owner: '217348698294714370'
+});
+
+client.registry
+ .registerDefaultTypes()
+ .registerGroups([
+ ['fun', 'fun command group'],
+ ['moderation', 'moderation command group'],
+ ['utility', 'utility command group'],
+ ['voice', 'voice command group']
+ ])
+ .registerDefaultGroups()
+ .registerDefaultCommands({
+ help: true
+ })
+ .registerCommandsIn(path.join(__dirname, 'commands'));
+
+client.once('ready', () => {
+ console.log(`Started bot: ${client.user.tag} (ID: ${client.user.id})\nCurrently running on ${client.guilds.cache.size} server(s).`);
+ client.user.setActivity('psycho~ uwu', {
+ type: 'LISTENING'
+ });
+ //client.channels.cache.get('600773421525237781').send('bot started up');
+});
+
+client.on('error', console.error);
+client.on('debug', console.debug);
+
+client.on('message', async msg => {
+ var msgContent = msg.content.toLowerCase();
+ function prefixCheck() {
+ if (msgContent.startsWith('s5n!')) {
+ return true;
+ }
+ }
+ if (prefixCheck()) {
+ if (msg.channel.type == 'dm') {
+ console.log(msg.author.tag, 'says', msgContent, 'in a dm');
+ } else {
+ console.log(msg.member.user.tag, 'says', msgContent, 'in #' + msg.channel.name);
+ }
+ }
+
+ if (msg.mentions.everyone) {
+ msg.react(':ArisaPing:695887537390223402');
+ }
+});
+
+client.login(config['secret']); \ No newline at end of file