mirror of
https://github.com/syuilo/ai.git
synced 2025-03-25 21:12:56 +00:00
Merge branch 'master' into feat/music
This commit is contained in:
commit
67faa7cbfc
9 changed files with 24 additions and 18 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,4 +2,3 @@ config.json
|
|||
built
|
||||
node_modules
|
||||
memory.json
|
||||
font.ttf
|
||||
|
|
BIN
font.ttf
Normal file
BIN
font.ttf
Normal file
Binary file not shown.
|
@ -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(),
|
||||
|
|
|
@ -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", "")
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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:');
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ export default class extends Module {
|
|||
if (Math.random() < 0.04) {
|
||||
this.post();
|
||||
}
|
||||
}, 1000 * 60 * 10);
|
||||
}, 1000 * 60 * 60);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
### なでなで
|
||||
「なでなで」「撫でて」「なでて」と投稿すると、藍が撫でに行きます。
|
||||
|
||||
### ねむい
|
||||
「ねむい」「眠い」と投稿すると、藍がお布団をかけてくれます。
|
||||
|
||||
### さむい
|
||||
「さむい」「寒い」と投稿すると、藍がぎゅーしてくれます。
|
||||
|
||||
## 藍の主な機能
|
||||
### 挨拶
|
||||
「おはよう」「おやすみ」などと話しかけると反応してくれます。
|
||||
|
|
Loading…
Reference in a new issue