diff --git a/.gitignore b/.gitignore index 6849230..a7b211e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ config.json built node_modules memory.json -font.ttf diff --git a/font.ttf b/font.ttf new file mode 100644 index 0000000..4123f48 Binary files /dev/null and b/font.ttf differ diff --git a/src/index.ts b/src/index.ts index cff6315..08cdde1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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(), diff --git a/src/modules/core/index.ts b/src/modules/core/index.ts index a430077..586e312 100644 --- a/src/modules/core/index.ts +++ b/src/modules/core/index.ts @@ -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", "") }); }); } diff --git a/src/modules/emoji-react/index.ts b/src/modules/emoji-react/index.ts index 52f41be..c460d9c 100644 --- a/src/modules/emoji-react/index.ts +++ b/src/modules/emoji-react/index.ts @@ -69,8 +69,11 @@ export default class extends Module { if (includes(note.text, ['寿司', 'sushi']) || note.text === 'すし') return react('🍣'); if (includes(note.text, ['藍'])) return react('🙌'); + 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:'); + } } diff --git a/src/modules/noting/index.ts b/src/modules/noting/index.ts index c695504..299521b 100644 --- a/src/modules/noting/index.ts +++ b/src/modules/noting/index.ts @@ -15,7 +15,7 @@ export default class extends Module { if (Math.random() < 0.04) { this.post(); } - }, 1000 * 60 * 10); + }, 1000 * 60 * 60); return {}; } diff --git a/src/modules/poll/index.ts b/src/modules/poll/index.ts index a5339f5..d43adfb 100644 --- a/src/modules/poll/index.ts +++ b/src/modules/poll/index.ts @@ -15,7 +15,7 @@ export default class extends Module { if (Math.random() < 0.1) { this.post(); } - }, 1000 * 60 * 60); + }, 1000 * 60 * 120); return { mentionHook: this.mentionHook, diff --git a/src/modules/reminder/index.ts b/src/modules/reminder/index.ts index 0e66942..9975137 100644 --- a/src/modules/reminder/index.ts +++ b/src/modules/reminder/index.ts @@ -6,7 +6,7 @@ import serifs, { getSerif } from '@/serifs'; import { acct } from '@/utils/acct'; import config from '@/config'; -const NOTIFY_INTERVAL = 1000 * 60 * 60 * 12; +const NOTIFY_INTERVAL = 1000 * 60 * 60 * 24; export default class extends Module { public readonly name = 'reminder'; diff --git a/torisetu.md b/torisetu.md index 88b0bf3..9f996fd 100644 --- a/torisetu.md +++ b/torisetu.md @@ -12,6 +12,12 @@ ### なでなで 「なでなで」「撫でて」「なでて」と投稿すると、藍が撫でに行きます。 +### ねむい +「ねむい」「眠い」と投稿すると、藍がお布団をかけてくれます。 + +### さむい +「さむい」「寒い」と投稿すると、藍がぎゅーしてくれます。 + ## 藍の主な機能 ### 挨拶 「おはよう」「おやすみ」などと話しかけると反応してくれます。