Skip to content

Commit

Permalink
feat: added command handler to my handlers (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tolfx committed Jan 17, 2023
1 parent 100f4b2 commit 3adeec5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/classes/MyHandler/MyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import filterAxiosError from '@tf2autobot/filter-axios-error';
import sendTf2SystemMessage from '../../lib/DiscordWebhook/sendTf2SystemMessage';
import sendTf2DisplayNotification from '../../lib/DiscordWebhook/sendTf2DisplayNotification';
import sendTf2ItemBroadcast from '../../lib/DiscordWebhook/sendTf2ItemBroadcast';
import CommandHandler from '../Commands/CommandHandler';

const filterReasons = (reasons: string[]) => {
const filtered = new Set(reasons);
Expand All @@ -61,6 +62,8 @@ const filterReasons = (reasons: string[]) => {
export default class MyHandler extends Handler {
readonly commands: Commands;

readonly commandHandler: CommandHandler;

readonly autokeys: Autokeys;

readonly cartQueue: CartQueue;
Expand Down Expand Up @@ -201,13 +204,15 @@ export default class MyHandler extends Handler {
super(bot);

this.commands = new Commands(bot, priceSource);
this.commandHandler = new CommandHandler(bot, priceSource);
this.cartQueue = new CartQueue(bot);
this.autokeys = new Autokeys(bot);

this.paths = genPaths(this.opt.steamAccountName);

PriceCheckQueue.setBot(this.bot);
PriceCheckQueue.setRequestCheckFn(this.priceSource.requestCheck.bind(this.priceSource));
this.commandHandler.registerCommands();
}

onRun(): Promise<OnRun> {
Expand Down

0 comments on commit 3adeec5

Please sign in to comment.