ai/test/__modules__/test.ts
syuilo fd50dc790f ✌️
2024-01-21 13:27:02 +09:00

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;
}
}
}