diff --git a/src/discord.ts b/src/discord.ts index 56d77407..e0db3902 100644 --- a/src/discord.ts +++ b/src/discord.ts @@ -13,6 +13,7 @@ import { SuperCommand } from './commands/super' import { PowaCommand } from './commands/powa' import { AlphaCommand } from './commands/alpha' import { GreetingEvent } from './events/greeting' +import { EnenEvent } from './events/enen' export class Discord { private config: Configuration @@ -43,7 +44,10 @@ export class Discord { this.client.on('ready', this.onReady.bind(this)) this.client.on('messageCreate', this.onMessageCreate.bind(this)) - const events: BaseDiscordEvent[] = [new GreetingEvent(this)] + const events: BaseDiscordEvent[] = [ + new GreetingEvent(this), + new EnenEvent(this), + ] for (const event of events) { event.register() } diff --git a/src/events/enen.ts b/src/events/enen.ts new file mode 100644 index 00000000..7ddaf36d --- /dev/null +++ b/src/events/enen.ts @@ -0,0 +1,14 @@ +import { Message } from 'discord.js' +import { BaseDiscordEvent } from '.' + +export class EnenEvent extends BaseDiscordEvent<'messageCreate'> { + get eventName(): 'messageCreate' { + return 'messageCreate' + } + + async execute(message: Message): Promise { + if (message.content.includes('えんえん')) { + await message.react('🥲') + } + } +}