Skip to content

Commit

Permalink
Fix excuses
Browse files Browse the repository at this point in the history
  • Loading branch information
nfaltermeier committed Apr 7, 2022
1 parent a929bcb commit f33fd2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async def on_ready():
logging.info(f'{datetime.now(timezone.utc)} Logged in as {client.user}')
donut.add_emoji(client, config)
minecraft.start(client, config)
excuse.load_excuses(config)

# API says this is called for thread creation and joining a thread...
@client.event
Expand All @@ -44,7 +45,7 @@ async def on_message(message):

await donut.on_message(message, config, client)
await soup.on_message(message, client, config)
await excuse.on_message(message, config)
await excuse.on_message(message)
if await roll.on_message(message):
return

Expand Down
4 changes: 2 additions & 2 deletions src/excuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def load_excuses(config):

def roll():
r = random.uniform(0, w)
for e in w_excuses:
for e in excuses:
if (e >= r):
return w_excuses[e]
return excuses[e]

trigger = re.compile(r"(^|\s)\$excuse($|\s)", re.MULTILINE)
async def on_message(message):
Expand Down

0 comments on commit f33fd2c

Please sign in to comment.