mirror of
https://github.com/syuilo/ai.git
synced 2025-03-25 21:12:56 +00:00
Merge branch 'master' into fix/maintenance
This commit is contained in:
commit
5e7a9ec1a9
5 changed files with 23 additions and 16 deletions
|
@ -14,7 +14,7 @@ const pkg = require('../package.json');
|
||||||
import CoreModule from './modules/core';
|
import CoreModule from './modules/core';
|
||||||
import TalkModule from './modules/talk';
|
import TalkModule from './modules/talk';
|
||||||
import BirthdayModule from './modules/birthday';
|
import BirthdayModule from './modules/birthday';
|
||||||
import ReversiModule from './modules/reversi';
|
// import ReversiModule from './modules/reversi';
|
||||||
import PingModule from './modules/ping';
|
import PingModule from './modules/ping';
|
||||||
import EmojiModule from './modules/emoji';
|
import EmojiModule from './modules/emoji';
|
||||||
import EmojiReactModule from './modules/emoji-react';
|
import EmojiReactModule from './modules/emoji-react';
|
||||||
|
@ -72,7 +72,7 @@ promiseRetry(retry => {
|
||||||
new FortuneModule(),
|
new FortuneModule(),
|
||||||
new GuessingGameModule(),
|
new GuessingGameModule(),
|
||||||
new KazutoriModule(),
|
new KazutoriModule(),
|
||||||
new ReversiModule(),
|
// new ReversiModule(),
|
||||||
new TimerModule(),
|
new TimerModule(),
|
||||||
new DiceModule(),
|
new DiceModule(),
|
||||||
new TalkModule(),
|
new TalkModule(),
|
||||||
|
|
|
@ -63,37 +63,31 @@ export default class extends Module {
|
||||||
@autobind
|
@autobind
|
||||||
private setName(msg: Message): boolean {
|
private setName(msg: Message): boolean {
|
||||||
if (!msg.text) {
|
if (!msg.text) {
|
||||||
console.error("Message text is empty or undefined.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg.text.includes('って呼んで')) {
|
if (!msg.text.includes('って呼んで')) {
|
||||||
console.error("Message text does not include 'って呼んで'.");
|
return false;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.text.startsWith('って呼んで')) {
|
if (msg.text.startsWith('って呼んで')) {
|
||||||
console.error("Message text starts with 'って呼んで'.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const matchResult = msg.text.match(/^(.+?)って呼んで/);
|
const matchResult = msg.text.match(/^(.+?)って呼んで/);
|
||||||
|
|
||||||
if (!matchResult) {
|
if (!matchResult) {
|
||||||
console.error("Name not found in the message text.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = matchResult[1];
|
const name = matchResult[1];
|
||||||
|
|
||||||
if (name.length > 20) {
|
if (name.length > 30) {
|
||||||
console.error("Name length exceeds 10 characters.");
|
|
||||||
msg.reply(serifs.core.tooLong);
|
msg.reply(serifs.core.tooLong);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (safeForInterpolate(name)) {
|
if (safeForInterpolate(name)) {
|
||||||
console.error("Invalid name.");
|
|
||||||
msg.reply(serifs.core.invalidName);
|
msg.reply(serifs.core.invalidName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -101,12 +95,16 @@ export default class extends Module {
|
||||||
const withSan = titles.some(t => name.endsWith(t));
|
const withSan = titles.some(t => name.endsWith(t));
|
||||||
|
|
||||||
if (withSan) {
|
if (withSan) {
|
||||||
msg.friend.updateName(name);
|
msg.friend.updateName(
|
||||||
|
name.replace("@ai", "")
|
||||||
|
.replace("@papi.n1l.dev", "")
|
||||||
|
);
|
||||||
msg.reply(serifs.core.setNameOk(name));
|
msg.reply(serifs.core.setNameOk(name));
|
||||||
} else {
|
} else {
|
||||||
msg.reply(serifs.core.san).then(reply => {
|
msg.reply(serifs.core.san).then(reply => {
|
||||||
this.subscribeReply(msg.userId, reply.id, {
|
this.subscribeReply(msg.userId, reply.id, {
|
||||||
name: name
|
name: name.replace("@ai", "")
|
||||||
|
.replace("@papi.n1l.dev", "")
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,10 +67,11 @@ export default class extends Module {
|
||||||
if (includes(note.text, ['ぴざ'])) return react('🍕');
|
if (includes(note.text, ['ぴざ'])) return react('🍕');
|
||||||
if (includes(note.text, ['ぷりん'])) return react('🍮');
|
if (includes(note.text, ['ぷりん'])) return react('🍮');
|
||||||
if (includes(note.text, ['寿司', 'sushi']) || note.text === 'すし') return react('🍣');
|
if (includes(note.text, ['寿司', 'sushi']) || note.text === 'すし') return react('🍣');
|
||||||
|
|
||||||
if (includes(note.text, ['藍'])) return react(':yay_ai:');
|
if (includes(note.text, ['藍'])) return react(':yay_ai:');
|
||||||
if (includes(note.text, ['なでなで'])) return react(':y6ymef3aio1q3iwchjx0rwf5:');
|
if (includes(note.text, ['なでなで'])) return react(':y6ymef3aio1q3iwchjx0rwf5:');
|
||||||
if (includes(note.text, ['なでて'])) return react(':blobcatpnd_onaka_nade:');
|
if (includes(note.text, ['なでて', '撫でて'])) return react(':blobcatpnd_onaka_nade:');
|
||||||
if (includes(note.text, ['撫でて'])) return react(':blobcatpnd_onaka_nade:');
|
if (includes(note.text, ['ねむい', '眠い', '寝ようかな', 'ねようかな'])) return react(':ahutontabeteagemasyoune:');
|
||||||
|
if (includes(note.text, ['さむい', '寒い'])) return react(':aa2luvzsqki2jnuq3emlaroc:');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,9 @@ const vocaloidUrls = [
|
||||||
'https://www.nicovideo.jp/watch/sm10150980',
|
'https://www.nicovideo.jp/watch/sm10150980',
|
||||||
'https://www.youtube.com/watch?v=CoL42lnNtp8',
|
'https://www.youtube.com/watch?v=CoL42lnNtp8',
|
||||||
'https://www.nicovideo.jp/watch/sm39853779',
|
'https://www.nicovideo.jp/watch/sm39853779',
|
||||||
'https://www.nicovideo.jp/watch/sm19748724'
|
'https://www.nicovideo.jp/watch/sm19466301',
|
||||||
|
'https://www.nicovideo.jp/watch/sm17520775',
|
||||||
|
'https://www.nicovideo.jp/watch/sm8089993'
|
||||||
// **
|
// **
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,12 @@
|
||||||
### なでなで
|
### なでなで
|
||||||
「なでなで」「撫でて」「なでて」と投稿すると、藍が撫でに行きます。
|
「なでなで」「撫でて」「なでて」と投稿すると、藍が撫でに行きます。
|
||||||
|
|
||||||
|
### ねむい
|
||||||
|
「ねむい」「眠い」と投稿すると、藍がお布団をかけてくれます。
|
||||||
|
|
||||||
|
### さむい
|
||||||
|
「さむい」「寒い」と投稿すると、藍がぎゅーしてくれます。
|
||||||
|
|
||||||
## 藍の主な機能
|
## 藍の主な機能
|
||||||
### 挨拶
|
### 挨拶
|
||||||
「おはよう」「おやすみ」などと話しかけると反応してくれます。
|
「おはよう」「おやすみ」などと話しかけると反応してくれます。
|
||||||
|
|
Loading…
Reference in a new issue