Skip to content

Commit

Permalink
added ET_REGEX oops
Browse files Browse the repository at this point in the history
  • Loading branch information
chanomkaimuk committed Aug 16, 2023
1 parent e8f1906 commit c22b5d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion commands/react_baltics/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
POSSIBLE_REACTS = (
"<:tw_baltics_heart:1132524940587962388>",
"<:bubblemilktea:1132632348651966596>",
"<:chaos:1140296704516706315>",
# "<:chaos:1140296704516706315>",
)

LT_REGEX_STR = r"Taivan(?:as|a|e|o|ui|ie(?:tiškas|tis|tė|či(?:ų|u|ai|ui|ams)))"
Expand Down Expand Up @@ -33,6 +33,9 @@
LV_REGEX = compile(
rf"\b(?:{LV_REGEX_STR})\b|{LV_REGEX_STR_TW}", flags=IGNORECASE | UNICODE
)
ET_REGEX = compile(
rf"\b(?:{ET_REGEX_STR})\b|{ET_REGEX_STR_TW}", flags=IGNORECASE | UNICODE
)

BALTIC_REGEX = compile(
rf"\b(?:{'|'.join(KEYWORDS)})\b|{LV_REGEX_STR_TW}|{LT_REGEX_STR_TW}|{ET_REGEX_STR_TW}",
Expand Down
8 changes: 5 additions & 3 deletions commands/react_baltics/react_baltics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import discord
import random
from .consts import POSSIBLE_REACTS, BALTIC_REGEX, LT_REGEX, LV_REGEX
from .consts import POSSIBLE_REACTS, BALTIC_REGEX, LT_REGEX, LV_REGEX, ET_REGEX
from ..modules.probability import mock_bernoulli


Expand All @@ -12,7 +12,9 @@ async def send_react_baltic(message: discord.Message):
for react in POSSIBLE_REACTS:
if mock_bernoulli(0.40):
await message.add_reaction(react)
if LV_REGEX.search(message.content) and mock_bernoulli(0.60):
if LV_REGEX.search(message.content) and mock_bernoulli(0.69):
await message.add_reaction("<:lv_tw_hgs:1139660598574055514>")
if LT_REGEX.search(message.content) and mock_bernoulli(0.60):
elif LT_REGEX.search(message.content) and mock_bernoulli(0.69):
await message.add_reaction("<:lt_tw_hgs:1139647918442283038>")
elif ET_REGEX.search(message.content) and mock_bernoulli(0.69):
await message.add_reaction("<:et_tw_hgs:1139660507167608882>")

0 comments on commit c22b5d6

Please sign in to comment.