mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-08-04 10:06:24 +09:00
Make async
This commit is contained in:
@ -21,7 +21,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
if (!msg.text) return false;
|
||||
|
||||
return (
|
||||
@ -313,7 +313,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private contextHook(msg: Message, data: any) {
|
||||
private async contextHook(msg: Message, data: any) {
|
||||
if (msg.text == null) return;
|
||||
|
||||
const done = () => {
|
||||
|
@ -14,7 +14,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
if (msg.text == null) return false;
|
||||
|
||||
const query = msg.text.match(/([0-9]+)[dD]([0-9]+)/);
|
||||
|
@ -137,7 +137,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
if (msg.includes(['顔文字', '絵文字', 'emoji', '福笑い'])) {
|
||||
const hand = hands[Math.floor(Math.random() * hands.length)];
|
||||
const face = faces[Math.floor(Math.random() * faces.length)];
|
||||
|
@ -13,7 +13,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
if (msg.text && msg.includes(['フォロー', 'フォロバ', 'follow me'])) {
|
||||
if (!msg.user.isFollowing) {
|
||||
this.ai.api('following/create', {
|
||||
|
@ -16,7 +16,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
if (msg.includes(['占', 'うらな', '運勢', 'おみくじ'])) {
|
||||
const date = new Date();
|
||||
const seed = `${date.getFullYear()}/${date.getMonth()}/${date.getDate()}@${msg.userId}`;
|
||||
|
@ -32,7 +32,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
if (!msg.includes(['数当て', '数あて'])) return false;
|
||||
|
||||
const exist = this.guesses.findOne({
|
||||
@ -69,7 +69,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private contextHook(msg: Message) {
|
||||
private async contextHook(msg: Message) {
|
||||
if (msg.text == null) return;
|
||||
|
||||
const exist = this.guesses.findOne({
|
||||
|
@ -13,7 +13,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
if (msg.text && msg.text.includes('ping')) {
|
||||
msg.reply('PONG!');
|
||||
return true;
|
||||
|
@ -33,7 +33,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
if (msg.includes(['リバーシ', 'オセロ', 'reversi', 'othello'])) {
|
||||
if (config.reversiEnabled) {
|
||||
msg.reply(serifs.reversi.ok);
|
||||
|
@ -14,7 +14,7 @@ export default class extends Module {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private mentionHook(msg: Message) {
|
||||
private async mentionHook(msg: Message) {
|
||||
const secondsQuery = (msg.text || '').match(/([0-9]+)秒/);
|
||||
const minutesQuery = (msg.text || '').match(/([0-9]+)分/);
|
||||
const hoursQuery = (msg.text || '').match(/([0-9]+)時間/);
|
||||
|
Reference in New Issue
Block a user