Skip to content

Commit

Permalink
feat: 健常者エミュレータ構文の作成 (#538)
Browse files Browse the repository at this point in the history
* feat: add kenjousha meme

* feat: add test-case
  • Loading branch information
m2en authored Oct 22, 2022
1 parent 69797c0 commit 7e5a297
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
35 changes: 35 additions & 0 deletions src/service/command/meme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,26 @@ describe('meme', () => {
);
});

it('use case of kenjou', async () => {
await responder.on(
createMockMessage(
parseStringsOrThrow(
[
'kenjou',
'ホテルのオートロックの鍵は部屋に置きっぱなしにしないほうがいい'
],
responder.schema
),
(message) => {
expect(message).toStrictEqual({
description:
'ホテルのオートロックの鍵は部屋に置きっぱなしにしないほうがいい - 健常者エミュレータ事例集Wiki'
});
}
)
);
});

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

it('args null (kenjou)', async () => {
await responder.on(
createMockMessage(
parseStringsOrThrow(['kenjou'], responder.schema),
(message) => {
expect(message).toStrictEqual({
title: '引数が不足してるみたいだ。',
description:
'はらちょのミーム機能を使うときは引数を忘れない方がいい - 健常者エミュレータ事例集Wiki'
});
}
)
);
});

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,5 +1,6 @@
import { dousurya } from './dousurya.js';
import { hukueki } from './hukueki.js';
import { kenjou } from './kenjou.js';
import { lolicon } from './lolicon.js';
import { moeta } from './moeta.js';
import { n } from './n.js';
Expand All @@ -15,5 +16,6 @@ export const memes = [
takopi,
nigetane,
web3,
moeta
moeta,
kenjou
];
14 changes: 14 additions & 0 deletions src/service/command/meme/kenjou.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { MemeTemplate } from '../../../model/meme-template.js';

export const kenjou: MemeTemplate<never, never> = {
commandNames: ['kenjou'],
description:
'[健常者エミュレーター](https://healthy-person-emulator.memo.wiki/)の構文ジェネレーター',
flagsKeys: [],
optionsKeys: [],
errorMessage:
'はらちょのミーム機能を使うときは引数を忘れない方がいい - 健常者エミュレータ事例集Wiki',
generate(args) {
return `${args.body} - 健常者エミュレータ事例集Wiki`;
}
};

0 comments on commit 7e5a297

Please sign in to comment.