summaryrefslogtreecommitdiff
path: root/src/bot.ts
blob: 4726acfc60a0745be6d6824db565ccee2b1143c4 (plain) (blame)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import config from './config.json';
import { CommandoClient } from 'discord.js-commando';
//import WS  from './ws/ws';
import path from 'path';
import { Structures } from 'discord.js';
import emoji from 'emoji-random';
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: 'uwu!',
    owner: '217348698294714370'
});

//var ws = new WS('123456', process.env.PORT, client)

client.registry
    .registerDefaultTypes()
    .registerGroups([
        ['fun', 'Fun Command Group'],
        ['moderation', 'Moderation Command Group'],
        ['utility', 'Utility Command Group'],
        ['voice', 'Voice Command Group'],
        ['nsfw', 'NSFW Command Group'],
        ['anime', 'Anime Command Group'],
        ['crypto', 'Crypto Command Group'],
        ['2b2t', '2B2T 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).`);
    console.log('Bot online!')
    console.log('\x1b[31m' + ` _   _                 __ _           
| | | |               / _(_)          
| | | |_      ___   _| |_ _  ___ _ __ 
| | | \\ \\ /\\ / / | | |  _| |/ _ \\ '__|
| |_| |\\ V  V /| |_| | | | |  __/ |   
 \\___/  \\_/\\_/  \\__,_|_| |_|\\___|_|   
                                      
                                      `)
    console.log('\x1b[0m' + 'discord.js Version: ' + '\x1b[36m' + '2.11')
    console.log('\x1b[0m' + 'Node.js Version: ' + '\x1b[36m' + process.version)
    console.log('\x1b[0m' + 'OS Version: ' + '\x1b[36m' + process.platform)
    console.log('\x1b[0m' + 'Name: ' + '\x1b[36m' + `${client.user?.tag}`)
    console.log('\x1b[0m' + 'ID: ' + '\x1b[36m' + `${client.user?.id}`)
    console.log('\x1b[0m' + 'Servers: ' + '\x1b[36m' + `${client.guilds.cache.size}` + '\x1b[0m')
    console.log()
    
    client.user.setActivity('uwu!help | v7.2.0', {
        type: 'WATCHING'
    });
});

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('uwu!')) {
            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 + ' in ' + msg.guild.name);
        }
    }
    
    if (msg.mentions.everyone) {
        msg.react(emoji.random());
    }
});

client.login(config['secret']);