From e828a67b0e1cd2e092fb55584983876190e9b51d Mon Sep 17 00:00:00 2001 From: Jozef Jankaj Date: Tue, 15 Feb 2022 10:19:46 +0100 Subject: [PATCH] poke should be fixed now --- cogs/poke.py | 16 +++++++++++++--- data/constants.py | 8 +++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/cogs/poke.py b/cogs/poke.py index e1a2e49..fb91001 100644 --- a/cogs/poke.py +++ b/cogs/poke.py @@ -78,18 +78,27 @@ class Poke(commands.Cog): await self.client.get_cog("Leaderboards").callLeaderboard("poke", ctx) async def pokeChecks(self, ctx): + # no mentions if len(ctx.message.mentions) == 0: await ctx.send("Dit is geen geldige persoon.") return False - if len(ctx.message.mentions) > 1: + # more than one mention? Check if Didier is tagged first + if len(ctx.message.mentions) > 1 and str(ctx.message.mentions[0].id) not in constants.didier_identities: await ctx.send("Je kan maar 1 persoon tegelijk tikken.") return False + + # author poking themselves if ctx.message.mentions[0].id == ctx.author.id: await ctx.send("Je kan jezelf niet tikken, {}.".format(ctx.author.display_name)) return False + + # author poking didier if ctx.message.mentions[0].id == self.client.user.id: - await ctx.send("Je kan me niet tikken, {}.".format(ctx.author.display_name)) - return False + if len(ctx.message.mentions) == 1: + await ctx.send("Je kan me niet tikken, {}.".format(ctx.author.display_name)) + return False + + # author poking bots if str(ctx.message.mentions[0].id) in constants.botIDs: await ctx.send("Je kan geen bots tikken, {}.".format(ctx.author.display_name)) return False @@ -106,6 +115,7 @@ class Poke(commands.Cog): await ctx.send("Deze persoon heeft zichzelf geblacklisted en kan niet meer getikt worden.") return False + print("passed the function") return True diff --git a/data/constants.py b/data/constants.py index 8f8a9cb..4cd7906 100644 --- a/data/constants.py +++ b/data/constants.py @@ -3,6 +3,12 @@ from enum import Enum myId = "171671190631481345" didierId = "680510935164911730" coolerDidierId = "728361496874057812" + +didier_identities = ["680510935164911730", # Didier + "728361496874057812", # coolerDidier + "831899971686760558", # Communist Didier + ] + botIDs = [ "155149108183695360", "234395307759108106", @@ -11,7 +17,7 @@ botIDs = [ "679679176466235399", "680510935164911730", "706148003949314069", - "728361496874057812" + "728361496874057812", ] BugReports = "762668401960812554" BotTesting = "679701786189103106"