Compare commits

...

5 Commits

Author SHA1 Message Date
syuilo 696c06dc29
Update vocabulary.ts 2022-07-20 12:20:22 +09:00
syuilo 45d8338b5a
Update vocabulary.ts 2022-07-18 16:05:45 +09:00
syuilo e2f257b4b1
Update vocabulary.ts 2022-06-18 02:27:21 +09:00
syuilo 21e594409d
Update vocabulary.ts 2022-06-09 03:55:00 +09:00
na2na 5cd9e171da
リマインド機能の改善 (#93)
* [reminder]renote対象が消されていた場合にリマインダー解除を行う機能の追加

* [reminder]visibilityがfollowersのときにtodoを受け付けないようにした

* #70(他人のリマインダーを操作できる)対応

* セリフのベタ書きではなく、serifsに追加するような形にした。

* Fix[Reminder]RN対象の削除がなされていた場合へ入る条件分岐の修正
2022-05-01 23:36:00 +09:00
4 changed files with 30 additions and 42 deletions

View File

@ -34,6 +34,10 @@ export default class Message {
return this.messageOrNote.renoteId;
}
public get visibility(): string {
return this.messageOrNote.visibility;
}
/**
*
*/

View File

@ -59,9 +59,12 @@ export default class extends Module {
const separatorIndex = text.indexOf(' ') > -1 ? text.indexOf(' ') : text.indexOf('\n');
const thing = text.substr(separatorIndex + 1).trim();
if (thing === '' && msg.quoteId == null) {
if (thing === '' && msg.quoteId == null || msg.visibility === 'followers') {
msg.reply(serifs.reminder.invalid);
return true;
return {
reaction: '🆖',
immediate: true,
};
}
const remind = this.reminds.insertOne({
@ -112,12 +115,16 @@ export default class extends Module {
const done = msg.includes(['done', 'やった', 'やりました', 'はい']);
const cancel = msg.includes(['やめる', 'やめた', 'キャンセル']);
const isOneself = msg.userId === remind.userId;
if (done || cancel) {
if ((done || cancel) && isOneself) {
this.unsubscribeReply(key);
this.reminds.remove(remind);
msg.reply(done ? getSerif(serifs.reminder.done(msg.friend.name)) : serifs.reminder.cancel);
return;
} else if (isOneself === false) {
msg.reply(serifs.reminder.doneFromInvalidUser);
return;
} else {
if (msg.isDm) this.unsubscribeReply(key);
return false;
@ -149,7 +156,12 @@ export default class extends Module {
text: acct(friend.doc.user) + ' ' + serifs.reminder.notify(friend.name)
});
} catch (err) {
// TODO: renote対象が消されていたらリマインダー解除
// renote対象が消されていたらリマインダー解除
if (err.statusCode === 400) {
this.unsubscribeReply(remind.thing == null && remind.quoteId ? remind.quoteId : remind.id);
this.reminds.remove(remind);
return;
}
return;
}
}

View File

@ -339,6 +339,8 @@ export default {
reminder: {
invalid: 'うーん...',
doneFromInvalidUser: 'イタズラはめっですよ!',
reminds: 'やること一覧です!',
notify: (name) => name ? `${name}、これやりましたか?` : `これやりましたか?`,

View File

@ -32,7 +32,7 @@ export const itemPrefixes = [
'折り畳み式',
'携帯型',
'遺伝子組み換え',
'突然変異して飛行能力を獲得した',
'飛行能力を獲得した',
'純金製',
'透明な',
'光る',
@ -119,36 +119,26 @@ export const itemPrefixes = [
'巨大',
'ナノサイズ',
'やわらかい',
'人の手に負えない',
'バグった',
'どこからともなく現れる',
'人工',
'天然',
'祀られた',
'チョコレートコーティング',
'地域で親しまれている',
'抗菌仕様',
'耐火',
'血行を良くする作用がある',
'なんらかのオーラを感じる',
'周囲の気温を上昇させる効果がある',
'激',
'猛',
'超',
'群生する',
'軽量',
'国宝級',
'称賛に値する',
'世界に通用する',
'一世を風靡した',
'流行りの',
'8カラットの',
'中古の',
'新品の',
'愛妻',
'ブランドものの',
'忘らるる',
'指数関数的勢いで増殖する',
'増殖する',
'ぷるぷる',
'ぐにゃぐにゃ',
'多目的',
@ -157,46 +147,28 @@ export const itemPrefixes = [
'先進的な',
'レトロな',
'ヴィンテージ',
'100日後に何らかが起きる',
'合法',
'プレミア付き',
'デカ',
'ギガ',
'穢れた',
'加護を受けた',
'品質保証付き',
'AppleCare+加入済み',
'えっちな',
'純粋な',
'構造上の欠陥がある',
'デザイナーズ',
'蠱惑的な',
'概念としての',
'霊験灼かな',
'御利益がありそうな',
'つやつや',
'べとべと',
'ムキムキ',
'ムキムキ',
'オーバークロックされた',
'リミッター解除された',
'無機質な',
'前衛的な',
'会社から支給された',
'担保としての',
'経費で落ちる',
'真贋が定かでない',
'肥えた',
'怪しい',
'妖しい',
'攻撃的な',
'現存する最古の',
'考古学的価値がある',
'官能的な',
'備え付けの',
'カビの生えた',
'丹念に熟成された',
'熟成',
'アルミダイキャスト',
'畏怖の念を抱く',
'養殖',
'やばい',
'すごい',
@ -204,8 +176,6 @@ export const itemPrefixes = [
'デジタル',
'アナログ',
'彁な',
'キミの',
'あなただけの',
'カラフルな',
'電動',
'当たり判定のない',
@ -221,7 +191,6 @@ export const itemPrefixes = [
'滅びの',
'反発係数がe>1の',
'摩擦係数0の',
'誉れ高き',
'解き放たれし',
'大きな',
'小さな',
@ -229,6 +198,8 @@ export const itemPrefixes = [
'うねうね',
'水没',
'燃え盛る',
'高圧',
'異常',
];
export const items = [
@ -471,19 +442,18 @@ export const items = [
'メビウスの輪',
'オリハルコン',
'ヘドロ',
'グレーチング',
'繝九Λ縺ョ縺ソ縺晄ア',
];
export const and = [
'に擬態した',
'入りの',
'が埋め込まれた',
'を連想させる',
'っぽい',
'に見せかけて',
'を虐げる',
'を侍らせた',
'が上に乗った',
'のそばにある',
];
export function genItem(seedOrRng?: (() => number) | string | number) {