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を追加 #713

Merged
merged 4 commits into from
Feb 7, 2023
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
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: [m2en, shun-shobon]
github: [m2en, shun-shobon, su8ru]
2 changes: 2 additions & 0 deletions src/service/command/meme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { n } from './n.js';
import { nigetane } from './nigetane.js';
import { nine } from './nine.js';
import { ojaru } from './ojaru.js';
import { syakai } from './syakai.js';
import { takopi } from './takopi.js';
import { tsureteike } from './tsureteike.js';
import { web3 } from './web3.js';
Expand All @@ -27,5 +28,6 @@ export const memes = [
ojaru,
nine,
tsureteike,
syakai,
clang
];
12 changes: 12 additions & 0 deletions src/service/command/meme/syakai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { MemeTemplate } from '../../../model/meme-template.js';

export const syakai: MemeTemplate<never, never> = {
commandNames: ['syakai'],
description: '「首相、~に否定的な考え ― 『社会が変わってしまう』」',
flagsKeys: [],
optionsKeys: [],
errorMessage: '極めて慎重に検討すべき課題だ',
generate(args) {
return `「首相、${args.body}に否定的な考え ― 『社会が変わってしまう』」`;
}
};
37 changes: 37 additions & 0 deletions src/service/command/meme/test/syakai.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { describe, expect, it } from 'vitest';

import { parseStringsOrThrow } from '../../../../adaptor/proxy/command/schema.js';
import { createMockMessage } from '../../command-message.js';
import { Meme } from '../../meme.js';

describe('meme', () => {
const responder = new Meme();

it('use case of syakai', async () => {
await responder.on(
createMockMessage(
parseStringsOrThrow(['syakai', 'Rust採用'], responder.schema),
(message) => {
expect(message).toStrictEqual({
description:
'「首相、Rust採用に否定的な考え ― 『社会が変わってしまう』」'
});
}
)
);
});

it('args null (syakai)', async () => {
await responder.on(
createMockMessage(
parseStringsOrThrow(['syakai'], responder.schema),
(message) => {
expect(message).toStrictEqual({
title: '引数が不足してるみたいだ。',
description: '極めて慎重に検討すべき課題だ'
});
}
)
);
});
});