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: 健常者エミュレータ構文の作成 #538

Merged
merged 6 commits into from
Oct 22, 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
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'
m1sk9 marked this conversation as resolved.
Show resolved Hide resolved
});
}
)
);
});

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`;
}
};