Skip to content

Commit

Permalink
refactor: change guard close order
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-montaigut committed Sep 4, 2023
1 parent 5787c91 commit 17cb129
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/quoiFeur/quoiFeur.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ const reactWithCoubeh = async (message: Message) => {
};

export const reactOnEndWithQuoi = async (message: Message) => {
if (!endWithQuoi(message.content)) return;

const channelIds = await cache.get('quoiFeurChannels', []);
const channelHasGame = channelIds.find((channelId) => channelId === message.channelId);
if (!channelHasGame) return;

if (!endWithQuoi(message.content)) return;

const probability = 1 / 20;

Math.random() <= probability ? await reactWithCoubeh(message) : await reactWithFeur(message);
Expand Down

0 comments on commit 17cb129

Please sign in to comment.