-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f61e99
commit 9209a58
Showing
2 changed files
with
14 additions
and
10 deletions.
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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import discord | ||
from .consts import POSSIBLE_REACTS, HGS_REGEX | ||
from .consts import POSSIBLE_REACTS_HGS, POSSIBLE_REACTS_TROLLS, HGS_REGEX | ||
from ..modules.probability import mock_bernoulli | ||
from random import shuffle | ||
from random import shuffle, choice | ||
|
||
|
||
def is_hgs_message(message: discord.Message): | ||
return HGS_REGEX.search(message.content) | ||
|
||
|
||
async def send_react_hgs(message: discord.Message): | ||
shuffle(POSSIBLE_REACTS) | ||
for react in POSSIBLE_REACTS: | ||
shuffle(POSSIBLE_REACTS_HGS) | ||
for react in POSSIBLE_REACTS_HGS: | ||
if mock_bernoulli(0.69): | ||
await message.add_reaction(react) | ||
if mock_bernoulli(0.87): | ||
await message.add_reaction(choice(POSSIBLE_REACTS_TROLLS)) |