5 |
import Database from './Database'; |
import Database from './Database'; |
6 |
import path from 'path'; |
import path from 'path'; |
7 |
import Logger from '../automod/Logger'; |
import Logger from '../automod/Logger'; |
|
import SpamFilter from '../automod/SpamFilter'; |
|
8 |
import SnippetManager from '../services/SnippetManager'; |
import SnippetManager from '../services/SnippetManager'; |
9 |
import AFKEngine from '../services/AFKEngine'; |
import AFKEngine from '../services/AFKEngine'; |
10 |
import Auth from '../services/Auth'; |
import Auth from '../services/Auth'; |
19 |
import DebugLogger from '../services/DebugLogger'; |
import DebugLogger from '../services/DebugLogger'; |
20 |
import BaseCLICommand from '../utils/structures/BaseCLICommand'; |
import BaseCLICommand from '../utils/structures/BaseCLICommand'; |
21 |
import discordModals from 'discord-modals'; |
import discordModals from 'discord-modals'; |
22 |
|
import SpamFilter from '../automod/SpamFilter'; |
23 |
|
|
24 |
export default class DiscordClient extends Client { |
export default class DiscordClient extends Client { |
25 |
private _commands = new Collection<string, BaseCommand>(); |
private _commands = new Collection<string, BaseCommand>(); |
51 |
constructor(options: ClientOptions, rootdir: string = __dirname) { |
constructor(options: ClientOptions, rootdir: string = __dirname) { |
52 |
super({ |
super({ |
53 |
ws: { |
ws: { |
54 |
properties: { |
properties: { |
55 |
$browser: "Discord iOS" |
$browser: "Discord iOS" |
56 |
} |
} |
57 |
}, |
}, |
58 |
...options |
...options |
59 |
}); |
}); |
60 |
|
|
61 |
|
console.log('init'); |
62 |
|
|
63 |
this.rootdir = rootdir; |
this.rootdir = rootdir; |
64 |
|
|
65 |
|
DiscordClient.client = this; |
66 |
|
|
67 |
this.config = new Config(this); |
this.config = new Config(this); |
68 |
this.db = new Database(path.resolve(rootdir, 'database.db'), this); |
this.db = new Database(path.resolve(rootdir, 'database.db'), this); |
81 |
this.randomStatus = new RandomStatus(this); |
this.randomStatus = new RandomStatus(this); |
82 |
this.debugLogger = new DebugLogger(this); |
this.debugLogger = new DebugLogger(this); |
83 |
|
|
84 |
DiscordClient.client = this; |
discordModals(this); |
|
discordModals(this); |
|
85 |
} |
} |
86 |
|
|
87 |
get commands(): Collection<string, BaseCommand> { |
get commands(): Collection<string, BaseCommand> { |