Skip to content

Commit

Permalink
react_hgs max one troll, chance 87%
Browse files Browse the repository at this point in the history
  • Loading branch information
chanomkaimuk committed Sep 28, 2023
1 parent 6f61e99 commit 9209a58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
14 changes: 8 additions & 6 deletions commands/react_hgs/consts.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
from re import compile, IGNORECASE, UNICODE

POSSIBLE_REACTS = [ # must be a list to be shuffleable
"<:LVTroll:1121321988854661200>",
"<:LTTroll:1121321991262183454>",
"<:TWTroll:1133368316908552232>",
"<:EETroll:1121321985180446791>",
"<:UATroll:1142824293470838854>",
POSSIBLE_REACTS_HGS = [ # must be a list to be shuffleable
"<:lt_tw_hgs:1139647918442283038>",
"<:lv_tw_hgs:1139660598574055514>",
"<:et_tw_hgs:1139660507167608882>",
"<:ua_tw_hgs:1145430238831063210>",
]
POSSIBLE_REACTS_TROLLS = [
"<:roc_troll:1133368648967405610>",
# "<:LVTroll:1121321988854661200>",
# "<:LTTroll:1121321991262183454>",
# "<:EETroll:1121321985180446791>",
# "<:UATroll:1142824293470838854>",
]

KEYWORDS_EN = (
"HGS",
Expand Down
10 changes: 6 additions & 4 deletions commands/react_hgs/react_hgs.py
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))

0 comments on commit 9209a58

Please sign in to comment.