Skip to content

Instantly share code, notes, and snippets.

@Soheab
Created January 15, 2020 20:30
Show Gist options
  • Save Soheab/77e4754ad54add61b33fcc89545aa022 to your computer and use it in GitHub Desktop.
Save Soheab/77e4754ad54add61b33fcc89545aa022 to your computer and use it in GitHub Desktop.
clown.
self.guild_detect = [336642139381301249]
self.channel_detect = [381963689470984203]
self.detect = []
self.lol = []
self.user_mes = []
@commands.Cog.listener()
async def on_message(self, message):
if message.author.bot:
return
if message.guild.id in self.guild_detect:
if message.channel.id in self.channel_detect:
if message.content.lower().startswith('clown'):
if message.author.id in self.user_mes:
self.user_mes.remove(message.author.id)
try:
await message.add_reaction('\U0001f921')
self.detect.append(message.id)
except discord.Forbidden:
return
@commands.Cog.listener()
async def on_reaction_add(self, reaction, user):
if user.id == self.bot.user.id:
return
if user.id in self.user_mes:
return
if str(reaction) == '\U0001f921':
if reaction.message.guild.id in self.guild_detect:
if reaction.message.channel.id in self.channel_detect:
if reaction.message.id in self.detect:
message = await reaction.message.channel.send(
f"🤡🤡 HAH {user.mention} **IS A CLOWN!!** 🤡🤡"
)
self.lol.append(message.id)
self.user_mes.append(user.id)
@commands.Cog.listener()
async def on_reaction_remove(self, reaction, user):
channel = self.bot.get_channel(667093175466328084)
if user.id == self.bot.user.id:
return
if str(reaction) == '\U0001f921':
if reaction.message.guild.id in self.guild_detect:
if reaction.message.channel.id in self.channel_detect:
if reaction.message.id in self.detect:
for message in self.lol:
try:
m = await channel.fetch_message(int(message))
await m.delete()
self.lol.remove(int(message))
except Exception as e:
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment