diff --git a/robocop_ng/cogs/meme.py b/robocop_ng/cogs/meme.py index 3e4bbfdc..35e534ed 100644 --- a/robocop_ng/cogs/meme.py +++ b/robocop_ng/cogs/meme.py @@ -195,7 +195,7 @@ async def bam_member(self, ctx, target: Optional[discord.Member]): if target is None and ctx.message.reference is None: await ctx.reply("https://tenor.com/view/bonk-gif-26414884") else: - if target is None: + if ctx.message.reference is not None: target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author diff --git a/robocop_ng/cogs/mod.py b/robocop_ng/cogs/mod.py index 3c1ee90f..db2e07d5 100644 --- a/robocop_ng/cogs/mod.py +++ b/robocop_ng/cogs/mod.py @@ -45,7 +45,9 @@ async def mute(self, ctx, target: Optional[discord.Member], *, reason: str = "") f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: + if target is not None: + reason = str(target) + reason target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author @@ -139,7 +141,9 @@ async def kick(self, ctx, target: Optional[discord.Member], *, reason: str = "") f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: + if target is not None: + reason = str(target) + reason target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author @@ -209,7 +213,9 @@ async def ban(self, ctx, target: Optional[discord.Member], *, reason: str = ""): f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: + if target is not None: + reason = str(target) + reason target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author @@ -281,7 +287,9 @@ async def bandel( f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: + if target is not None: + reason = str(target) + reason target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author @@ -539,7 +547,7 @@ async def approve( f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author @@ -578,7 +586,7 @@ async def revoke( f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author @@ -624,7 +632,9 @@ async def warn(self, ctx, target: Optional[discord.Member], *, reason: str = "") f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: + if target is not None: + reason = str(target) + reason target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author @@ -778,7 +788,7 @@ async def nickname(self, ctx, target: Optional[discord.Member], *, nick: str = " f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author diff --git a/robocop_ng/cogs/mod_timed.py b/robocop_ng/cogs/mod_timed.py index ef9d2105..01346242 100644 --- a/robocop_ng/cogs/mod_timed.py +++ b/robocop_ng/cogs/mod_timed.py @@ -31,7 +31,9 @@ async def timeban( f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: + if target is not None: + duration = str(target) + duration target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author @@ -107,7 +109,9 @@ async def timemute( f"I'm sorry {ctx.author.mention}, I'm afraid I can't do that." ) else: - if target is None: + if ctx.message.reference is not None: + if target is not None: + duration = str(target) + duration target = ( await ctx.channel.fetch_message(ctx.message.reference.message_id) ).author