2019-06-29 17:08:23 +02:00
|
|
|
const fs = require('fs');
|
|
|
|
if (!fs.existsSync('./config.json')) {
|
|
|
|
throw new Error('I could not find config.json, are you sure you have it?');
|
|
|
|
}
|
2019-01-02 10:21:21 +01:00
|
|
|
const { AkairoClient, CommandHandler, InhibitorHandler, ListenerHandler } = require('discord-akairo');
|
2020-11-11 01:55:04 +01:00
|
|
|
const { Intents } = require('discord.js');
|
2019-01-02 10:21:21 +01:00
|
|
|
const { token, prefix, ownerID } = require('./config.json');
|
|
|
|
|
2020-11-11 01:55:04 +01:00
|
|
|
let intents = new Intents(Intents.ALL);
|
|
|
|
intents.remove('GUILD_PRESENCES');
|
|
|
|
|
2019-01-02 10:21:21 +01:00
|
|
|
class hahaYesClient extends AkairoClient {
|
|
|
|
constructor() {
|
|
|
|
super({
|
|
|
|
ownerID: ownerID,
|
2019-12-27 01:57:30 +01:00
|
|
|
presence: {
|
|
|
|
status: 'online',
|
|
|
|
activity: {
|
|
|
|
type: 'PLAYING',
|
|
|
|
name: 'Loading simulator...',
|
|
|
|
}
|
|
|
|
}
|
2019-01-02 10:21:21 +01:00
|
|
|
}, {
|
2020-11-11 01:55:04 +01:00
|
|
|
partials: ['MESSAGE'],
|
2020-11-05 14:45:16 +01:00
|
|
|
disableMentions: 'everyone',
|
2021-03-13 20:19:42 +01:00
|
|
|
intents: intents
|
2019-01-02 10:21:21 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
this.commandHandler = new CommandHandler(this, {
|
|
|
|
directory: './commands/',
|
|
|
|
prefix: prefix,
|
2019-06-23 03:41:59 +02:00
|
|
|
argumentDefaults: {
|
|
|
|
prompt: {
|
|
|
|
timeout: 'Time ran out, command has been cancelled.',
|
|
|
|
ended: 'Too many retries, command has been cancelled.',
|
2020-07-16 09:24:17 +02:00
|
|
|
retry: 'Could not find your argument, please try again! Say `cancel` to stop the command',
|
2019-06-23 03:41:59 +02:00
|
|
|
cancel: 'Command has been cancelled.',
|
|
|
|
retries: 4,
|
|
|
|
time: 30000
|
|
|
|
}
|
|
|
|
},
|
2019-01-02 10:21:21 +01:00
|
|
|
commandUtil: true,
|
2019-01-02 21:46:45 +01:00
|
|
|
commandUtilLifetime: 60000,
|
2019-01-02 10:21:21 +01:00
|
|
|
allowMention: true,
|
|
|
|
handleEdits: true,
|
2019-05-10 16:43:55 +02:00
|
|
|
ignorePermissions: ownerID,
|
|
|
|
ignoreCooldown: ownerID,
|
2019-01-02 10:21:21 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
this.inhibitorHandler = new InhibitorHandler(this, {
|
2019-01-10 08:58:33 +01:00
|
|
|
directory: './event/inhibitors/',
|
2019-01-02 10:21:21 +01:00
|
|
|
emitters: {
|
|
|
|
process
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
this.listenerHandler = new ListenerHandler(this, {
|
2019-01-10 08:58:33 +01:00
|
|
|
directory: './event/listeners/'
|
2019-01-02 10:21:21 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
this.listenerHandler.setEmitters({
|
|
|
|
commandHandler: this.commandHandler,
|
|
|
|
inhibitorHandler: this.inhibitorHandler,
|
2019-12-27 23:05:31 +01:00
|
|
|
listenerHandler: this.listenerHandler,
|
|
|
|
process: process
|
2019-01-02 10:21:21 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
this.commandHandler.useInhibitorHandler(this.inhibitorHandler);
|
|
|
|
this.commandHandler.useListenerHandler(this.listenerHandler);
|
|
|
|
|
|
|
|
this.listenerHandler.loadAll();
|
|
|
|
this.inhibitorHandler.loadAll();
|
|
|
|
this.commandHandler.loadAll();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const client = new hahaYesClient();
|
2020-11-05 14:45:16 +01:00
|
|
|
client.login(token);
|