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: 燃えたmemeの追加 #380

Merged
merged 3 commits into from
Aug 6, 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
37 changes: 37 additions & 0 deletions src/service/command/meme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,24 @@ describe('meme', () => {
);
});

it('use case of moeta', async () => {
await responder.on(
'CREATE',
createMockMessage(
{
args: ['moeta', '雪']
},
(message) => {
expect(message).toStrictEqual({
description:
'「久留米の花火大会ね、寮から見れたの?」\n「うん ついでに雪が燃えた」\n「は?」'
});
return Promise.resolve();
}
)
);
});

it('args space', async () => {
await responder.on(
'CREATE',
Expand Down Expand Up @@ -274,6 +292,25 @@ describe('meme', () => {
);
});

it('args null (moeta)', async () => {
await responder.on(
'CREATE',
createMockMessage(
{
args: ['moeta']
},
(message) => {
expect(message).toStrictEqual({
title: '引数が不足してるみたいだ。',
description:
'[元ネタ](https://twitter.com/yuki_yuigishi/status/1555557259798687744)'
});
return Promise.resolve();
}
)
);
});

it('delete message', async () => {
const fn = vi.fn();
await responder.on(
Expand Down
3 changes: 2 additions & 1 deletion src/service/command/meme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import type { MessageEvent } from '../../runner/index.js';
import { dousurya } from './meme/dousurya.js';
import { hukueki } from './meme/hukueki.js';
import { lolicon } from './meme/lolicon.js';
import { moeta } from './meme/moeta.js';
import { n } from './meme/n.js';
import { nigetane } from './meme/nigetane.js';
import parse from 'cli-argparse';
import { takopi } from './meme/takopi.js';
import { web3 } from './meme/web3.js';

const memes = [dousurya, hukueki, lolicon, n, takopi, nigetane, web3];
const memes = [dousurya, hukueki, lolicon, n, takopi, nigetane, web3, moeta];
const memesByCommandName: Record<
string,
MemeTemplate<string, string> | undefined
Expand Down
13 changes: 13 additions & 0 deletions src/service/command/meme/moeta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { MemeTemplate } from '../../../model/meme-template.js';

export const moeta: MemeTemplate<never, never> = {
commandNames: ['moeta', 'yuki'],
description: '久留米の花火大会ね、寮から見れたの?',
flagsKeys: [],
optionsKeys: [],
errorMessage:
'[元ネタ](https://twitter.com/yuki_yuigishi/status/1555557259798687744)',
generate(args) {
return `「久留米の花火大会ね、寮から見れたの?」\n「うん ついでに${args.body}が燃えた」\n「は?」`;
}
};