Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: コウメ太夫構文ジェネレーターの追加 #584

Merged
merged 10 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/service/command/meme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,23 @@ describe('meme', () => {
);
});

it('use case of koume', async () => {
await responder.on(
createMockMessage(
parseStringsOrThrow(
['koume', 'RSA鍵を登録した', 'ed25519'],
responder.schema
),
(message) => {
expect(message).toStrictEqual({
description:
'RSA鍵を登録したと思ったら〜♪\n\ned25519でした〜♪\n\nチクショー!! #まいにちチクショー'
});
}
)
);
});

it('args space', async () => {
await responder.on(
createMockMessage(
Expand Down Expand Up @@ -293,6 +310,21 @@ describe('meme', () => {
);
});

it('args null (koume)', async () => {
await responder.on(
createMockMessage(
parseStringsOrThrow(['koume'], responder.schema),
(message) => {
expect(message).toStrictEqual({
title: '引数が不足してるみたいだ。',
description:
'MEMEを表示しようと思ったら〜♪ 引数が足りませんでした〜♪ チクショー!!'
});
}
)
);
});

it('delete message', async () => {
const fn = vi.fn();
await responder.on(
Expand Down
4 changes: 3 additions & 1 deletion src/service/command/meme/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { dousurya } from './dousurya.js';
import { hukueki } from './hukueki.js';
import { kenjou } from './kenjou.js';
import { koume } from './koume.js';
import { lolicon } from './lolicon.js';
import { moeta } from './moeta.js';
import { n } from './n.js';
Expand All @@ -17,5 +18,6 @@ export const memes = [
nigetane,
web3,
moeta,
kenjou
kenjou,
koume
];
16 changes: 16 additions & 0 deletions src/service/command/meme/koume.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { MemeTemplate } from '../../../model/meme-template.js';

export const koume: MemeTemplate<never, never> = {
commandNames: ['koume'],
description: 'チクショー!! `#毎日チクショー`',
flagsKeys: [],
optionsKeys: [],
errorMessage:
'MEMEを表示しようと思ったら〜♪ 引数が足りませんでした〜♪ チクショー!!',
generate(args) {
const [option1, option2] = args.body.split(' ');
// Reason: 構文とコウメ太夫に敬意を払い、元ネタを尊重することから全角スペースを使用したいのでeslintの警告をBANします。
// eslint-disable-next-line no-irregular-whitespace
return `${option1}と思ったら〜♪\n\n${option2}でした〜♪\n\nチクショー!! #まいにちチクショー`;
}
};