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
|
built
|
||||||
node_modules
|
node_modules
|
||||||
memory.json
|
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 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", "")
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,8 +69,11 @@ export default class extends Module {
|
||||||
if (includes(note.text, ['寿司', 'sushi']) || note.text === 'すし') return react('🍣');
|
if (includes(note.text, ['寿司', 'sushi']) || note.text === 'すし') return react('🍣');
|
||||||
|
|
||||||
if (includes(note.text, ['藍'])) return react('🙌');
|
if (includes(note.text, ['藍'])) return react('🙌');
|
||||||
|
|
||||||
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:');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default class extends Module {
|
||||||
if (Math.random() < 0.04) {
|
if (Math.random() < 0.04) {
|
||||||
this.post();
|
this.post();
|
||||||
}
|
}
|
||||||
}, 1000 * 60 * 10);
|
}, 1000 * 60 * 60);
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default class extends Module {
|
||||||
if (Math.random() < 0.1) {
|
if (Math.random() < 0.1) {
|
||||||
this.post();
|
this.post();
|
||||||
}
|
}
|
||||||
}, 1000 * 60 * 60);
|
}, 1000 * 60 * 120);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mentionHook: this.mentionHook,
|
mentionHook: this.mentionHook,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import serifs, { getSerif } from '@/serifs';
|
||||||
import { acct } from '@/utils/acct';
|
import { acct } from '@/utils/acct';
|
||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
|
|
||||||
const NOTIFY_INTERVAL = 1000 * 60 * 60 * 12;
|
const NOTIFY_INTERVAL = 1000 * 60 * 60 * 24;
|
||||||
|
|
||||||
export default class extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'reminder';
|
public readonly name = 'reminder';
|
||||||
|
|
|
@ -12,6 +12,12 @@
|
||||||
### なでなで
|
### なでなで
|
||||||
「なでなで」「撫でて」「なでて」と投稿すると、藍が撫でに行きます。
|
「なでなで」「撫でて」「なでて」と投稿すると、藍が撫でに行きます。
|
||||||
|
|
||||||
|
### ねむい
|
||||||
|
「ねむい」「眠い」と投稿すると、藍がお布団をかけてくれます。
|
||||||
|
|
||||||
|
### さむい
|
||||||
|
「さむい」「寒い」と投稿すると、藍がぎゅーしてくれます。
|
||||||
|
|
||||||
## 藍の主な機能
|
## 藍の主な機能
|
||||||
### 挨拶
|
### 挨拶
|
||||||
「おはよう」「おやすみ」などと話しかけると反応してくれます。
|
「おはよう」「おやすみ」などと話しかけると反応してくれます。
|
||||||
|
|
Loading…
Reference in a new issue