Kill clyde refactor to use new builtin base

This commit is contained in:
Jiiks 2018-08-25 16:55:58 +03:00
parent f5b70d5a23
commit aa0882c449
1 changed files with 8 additions and 10 deletions

View File

@ -13,18 +13,16 @@ import { Patcher, MonkeyPatch, Reflection } from 'modules';
export default new class KillClyde extends BuiltinModule {
get settingPath() {
return ['ui', 'default', 'kill-clyde'];
}
/* Getters */
get moduleName() { return 'KillClyde' }
async enabled(e) {
if (Patcher.getPatchesByCaller('BD:KillClyde').length) return;
get settingPath() { return ['ui', 'default', 'kill-clyde'] }
/* Patches */
applyPatches() {
if (this.patches.length) return;
const { MessageActions } = Reflection.modules;
MonkeyPatch('BD:KillClyde', MessageActions).instead('sendBotMessage', void 0);
}
disabled(e) {
Patcher.unpatchAll('BD:KillClyde');
this.patch(MessageActions, 'sendBotMessage', () => void 0, 'instead');
}
}