Skip to content

Commit

Permalink
only allow usable reactions (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
eibex authored Feb 16, 2020
1 parent e67ab9a commit 6b031b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ async def on_message(message):
if msg[0].lower() != "done":
# Stores reaction-role combinations until "done" is received
try:
await message.add_reaction(msg[0])
rlightfm.step2(r_id, str(message.role_mentions[0].id), msg[0])
except IndexError:
await message.channel.send("Please mention a role after the reaction. Example:\n:smile: `@Role`")
await message.channel.send("Mention a role after the reaction. Example:\n:smile: `@Role`")
except discord.HTTPException:
await message.channel.send("You can only use reactions uploaded to this server or standard emojis.")
else:
# If "done" is received the combinations are written to CSV
# Advances to step three
Expand Down Expand Up @@ -257,7 +260,7 @@ async def new(ctx):
# For future prompts (see: "async def on_message(message)")
rlightfm.listen(ctx.message.author.id, ctx.message.channel.id)
await ctx.send(
"Please mention the #channel where to send the auto-role message."
"Mention the #channel where to send the auto-role message."
)
else:
await ctx.send("You do not have an admin role.")
Expand Down

0 comments on commit 6b031b2

Please sign in to comment.