Refactor message edit reaction logic for improved readability
This commit is contained in:
parent
db0457b7be
commit
be1cc61443
1 changed files with 5 additions and 1 deletions
|
@ -113,7 +113,11 @@ async def add_more_reaction(reaction, user):
|
|||
|
||||
@bot.listen("on_message_edit")
|
||||
async def react_message_edit(before: discord.Message, after: discord.Message) -> None:
|
||||
if before.content != after.content and after.author != bot.user and random.random() < 50 / 100:
|
||||
if (
|
||||
before.content != after.content
|
||||
and after.author != bot.user
|
||||
and random.random() < 50 / 100
|
||||
):
|
||||
logger.info(f"React to edit from {after.author}")
|
||||
await after.add_reaction("👀")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue