diff options
Diffstat (limited to 'bot.js')
| -rw-r--r-- | bot.js | 60 |
1 files changed, 34 insertions, 26 deletions
@@ -1,8 +1,22 @@ -const config = require('./config.json'); -const { CommandoClient } = require('discord.js-commando'); -const path = require('path'); -const { Structures } = require('discord.js'); -Structures.extend('Guild', Guild => { +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const config_json_1 = __importDefault(require("./config.json")); +const discord_js_commando_1 = require("discord.js-commando"); +const path_1 = __importDefault(require("path")); +const discord_js_1 = require("discord.js"); +discord_js_1.Structures.extend('Guild', Guild => { class MusicGuild extends Guild { constructor(client, data) { super(client, data); @@ -16,38 +30,33 @@ Structures.extend('Guild', Guild => { } return MusicGuild; }); - -const client = new CommandoClient({ +const client = new discord_js_commando_1.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'] - ]) + ['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', () => { + help: true +}) + .registerCommandsIn(path_1.default.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 => { +client.on('message', (msg) => __awaiter(void 0, void 0, void 0, function* () { var msgContent = msg.content.toLowerCase(); function prefixCheck() { if (msgContent.startsWith('s5n!')) { @@ -57,14 +66,13 @@ client.on('message', async msg => { if (prefixCheck()) { if (msg.channel.type == 'dm') { console.log(msg.author.tag, 'says', msgContent, 'in a DM'); - } else { + } + 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 +})); +client.login(config_json_1.default['secret']); |