mirror of
https://github.com/syuilo/ai.git
synced 2024-11-09 23:48:01 +00:00
27 lines
472 B
TypeScript
27 lines
472 B
TypeScript
import { bindThis } from '@/decorators.js';
|
|
import Module from '@/module.js';
|
|
import Message from '@/message';
|
|
|
|
export default class extends Module {
|
|
public readonly name = 'test';
|
|
|
|
@bindThis
|
|
public install() {
|
|
return {
|
|
mentionHook: this.mentionHook
|
|
};
|
|
}
|
|
|
|
@bindThis
|
|
private async mentionHook(msg: Message) {
|
|
if (msg.text && msg.text.includes('ping')) {
|
|
msg.reply('PONG!', {
|
|
immediate: true
|
|
});
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|