Skip to content

Commit

Permalink
fix(event): permission check for Xmas reaction
Browse files Browse the repository at this point in the history
  • Loading branch information
ZRunner committed Dec 27, 2023
1 parent 0391be9 commit e124d95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/bot_events/subcogs/christmas_subcog.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ async def on_raw_reaction_add(self, payload):
if self.current_event_data["icon"]:
embed.set_image(url=self.current_event_data["icon"])
# get the destination channel
if (channel := self.bot.get_channel(payload.channel_id)) and channel.permissions_for(channel.guild.me).send_messages:
if (
(channel := self.bot.get_channel(payload.channel_id))
and channel.permissions_for(channel.guild.me).send_messages
and channel.permissions_for(channel.guild.me).embed_links
):
await channel.send(embed=embed, delete_after=12)
# send the rank card notification if needed
await self.bot.get_cog("BotEvents").check_and_send_card_unlocked_notif(channel, payload.user_id)
Expand Down

0 comments on commit e124d95

Please sign in to comment.