-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: あっぱれおじゃる様ミーム構文の追加 * chore: ヘルプ文の変更 Co-authored-by: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com>
- Loading branch information
1 parent
38f5d03
commit 2cbfad1
Showing
3 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { MemeTemplate } from '../../../model/meme-template.js'; | ||
|
||
const ojaruFlags = ['g'] as const; | ||
|
||
export const ojaru: MemeTemplate<typeof ojaruFlags[number], never> = { | ||
commandNames: ['ojaru'], | ||
description: | ||
'あっぱれおじゃる様!見事ミーム構文を使いこなされました!`-g`オプションを使用なさってデンボの口調の変更も可能でございます!', | ||
flagsKeys: ojaruFlags, | ||
optionsKeys: [], | ||
errorMessage: | ||
'あっぱれおじゃる様!コマンド形式を間違えエラーをお出しになられました!', | ||
generate(args) { | ||
if (args.flags.g) return `あっぱれおじゃる様!${args.body}でございます!`; | ||
return `あっぱれおじゃる様!見事${args.body}されました!`; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
import { Meme } from '../../meme.js'; | ||
|
||
import { createMockMessage } from '../../command-message.js'; | ||
import { parseStringsOrThrow } from '../../../../adaptor/proxy/command/schema.js'; | ||
|
||
describe('meme', () => { | ||
const responder = new Meme(); | ||
|
||
it('use case of ojaru', async () => { | ||
await responder.on( | ||
createMockMessage( | ||
parseStringsOrThrow( | ||
['ojaru', '欠課時数で落単をふやし、留年を確定な'], | ||
responder.schema | ||
), | ||
(message) => { | ||
expect(message).toStrictEqual({ | ||
description: | ||
'あっぱれおじゃる様!見事欠課時数で落単をふやし、留年を確定なされました!' | ||
}); | ||
} | ||
) | ||
); | ||
}); | ||
|
||
it('use case of ojaru (-g option)', async () => { | ||
await responder.on( | ||
createMockMessage( | ||
parseStringsOrThrow( | ||
['ojaru', '-g', '数学の成績不足で管理者からタイムアウト'], | ||
responder.schema | ||
), | ||
(message) => { | ||
expect(message).toStrictEqual({ | ||
description: | ||
'あっぱれおじゃる様!数学の成績不足で管理者からタイムアウトでございます!' | ||
}); | ||
} | ||
) | ||
); | ||
}); | ||
|
||
it('args null (ojaru)', async () => { | ||
await responder.on( | ||
createMockMessage( | ||
parseStringsOrThrow(['ojaru'], responder.schema), | ||
(message) => { | ||
expect(message).toStrictEqual({ | ||
title: '引数が不足してるみたいだ。', | ||
description: | ||
'あっぱれおじゃる様!コマンド形式を間違えエラーをお出しになられました!' | ||
}); | ||
} | ||
) | ||
); | ||
}); | ||
}); |