From ee3634b6e988cd406fbb6d35efab891f9acd824b Mon Sep 17 00:00:00 2001 From: Baviaan Date: Wed, 20 Nov 2019 18:10:25 +0000 Subject: [PATCH] Ignore remaining emojis if >20 --- meowth/exts/raid/raid_cog.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/meowth/exts/raid/raid_cog.py b/meowth/exts/raid/raid_cog.py index 9b15e481f..f1e0b3997 100644 --- a/meowth/exts/raid/raid_cog.py +++ b/meowth/exts/raid/raid_cog.py @@ -632,7 +632,10 @@ async def setup_raid(self, ctx, new_raid: Raid): for react in react_list: if isinstance(react, int): react = self.bot.get_emoji(react) - await reportmsg.add_reaction(react) + try: + await reportmsg.add_reaction(react) + except discord.Forbidden: + break new_raid.message_ids.append(f"{reportmsg.channel.id}/{reportmsg.id}") elif raid_mode.isdigit(): catid = int(raid_mode) @@ -664,7 +667,10 @@ async def setup_raid(self, ctx, new_raid: Raid): for react in react_list: if isinstance(react, int): react = self.bot.get_emoji(react) - await raidmsg.add_reaction(react) + try: + await raidmsg.add_reaction(react) + except discord.Forbidden: + break new_raid.message_ids.append(f"{raidmsg.channel.id}/{raidmsg.id}") reportcontent = f"Coordinate this raid in {raid_channel.mention}!" for channel in report_channels: @@ -675,7 +681,10 @@ async def setup_raid(self, ctx, new_raid: Raid): for react in react_list: if isinstance(react, int): react = self.bot.get_emoji(react) - await reportmsg.add_reaction(react) + try: + await reportmsg.add_reaction(react) + except discord.Forbidden: + break new_raid.message_ids.append(f"{reportmsg.channel.id}/{reportmsg.id}") await new_raid.upsert() for message_id in new_raid.message_ids: