Merge branch 'master' into fix/maintenance

This commit is contained in:
n1lsqn 2023-12-19 23:10:02 +09:00 committed by GitHub
commit 5e7a9ec1a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 16 deletions

View file

@ -14,7 +14,7 @@ const pkg = require('../package.json');
import CoreModule from './modules/core';
import TalkModule from './modules/talk';
import BirthdayModule from './modules/birthday';
import ReversiModule from './modules/reversi';
// import ReversiModule from './modules/reversi';
import PingModule from './modules/ping';
import EmojiModule from './modules/emoji';
import EmojiReactModule from './modules/emoji-react';
@ -72,7 +72,7 @@ promiseRetry(retry => {
new FortuneModule(),
new GuessingGameModule(),
new KazutoriModule(),
new ReversiModule(),
// new ReversiModule(),
new TimerModule(),
new DiceModule(),
new TalkModule(),

View file

@ -63,37 +63,31 @@ export default class extends Module {
@autobind
private setName(msg: Message): boolean {
if (!msg.text) {
console.error("Message text is empty or undefined.");
return false;
}
if (!msg.text.includes('って呼んで')) {
console.error("Message text does not include 'って呼んで'.");
return false;
return false;
}
if (msg.text.startsWith('って呼んで')) {
console.error("Message text starts with 'って呼んで'.");
return false;
}
const matchResult = msg.text.match(/^(.+?)って呼んで/);
if (!matchResult) {
console.error("Name not found in the message text.");
return false;
}
const name = matchResult[1];
if (name.length > 20) {
console.error("Name length exceeds 10 characters.");
if (name.length > 30) {
msg.reply(serifs.core.tooLong);
return true;
}
if (safeForInterpolate(name)) {
console.error("Invalid name.");
msg.reply(serifs.core.invalidName);
return true;
}
@ -101,12 +95,16 @@ export default class extends Module {
const withSan = titles.some(t => name.endsWith(t));
if (withSan) {
msg.friend.updateName(name);
msg.friend.updateName(
name.replace("@ai", "")
.replace("@papi.n1l.dev", "")
);
msg.reply(serifs.core.setNameOk(name));
} else {
msg.reply(serifs.core.san).then(reply => {
this.subscribeReply(msg.userId, reply.id, {
name: name
name: name.replace("@ai", "")
.replace("@papi.n1l.dev", "")
});
});
}

View file

@ -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, ['寿司', 'sushi']) || note.text === 'すし') return react('🍣');
if (includes(note.text, ['藍'])) return react(':yay_ai:');
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:');
}
}

View file

@ -105,7 +105,9 @@ const vocaloidUrls = [
'https://www.nicovideo.jp/watch/sm10150980',
'https://www.youtube.com/watch?v=CoL42lnNtp8',
'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'
// **
]

View file

@ -12,6 +12,12 @@
### なでなで
「なでなで」「撫でて」「なでて」と投稿すると、藍が撫でに行きます。
### ねむい
「ねむい」「眠い」と投稿すると、藍がお布団をかけてくれます。
### さむい
「さむい」「寒い」と投稿すると、藍がぎゅーしてくれます。
## 藍の主な機能
### 挨拶
「おはよう」「おやすみ」などと話しかけると反応してくれます。