Skip to content

Commit

Permalink
Refactor handleMessageCreate to handle message replies and add sasuda…
Browse files Browse the repository at this point in the history
…i reaction
  • Loading branch information
k-taro56 committed Jun 3, 2024
1 parent 9d91b17 commit 4da1973
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ describe('handleMessageCreate', () => {
expect(mockDelete).not.toHaveBeenCalled();
});

it('should delete the message and react to the replied message if the command is used', async () => {
const message = createMockMessage({
content: '!daihyo',
channelType: ChannelType.GuildText,
hasReference: true,
});

await handleMessageCreateCurried(message);

expect(mockDelete).toHaveBeenCalled();
expectReactionsToHaveBeenCalled(mockReact);
});

it('replies with a specific URL and reacts when the message content is "!sasudai"', async () => {
const message = createMockMessage({
content: '!sasudai',
Expand Down

0 comments on commit 4da1973

Please sign in to comment.