reply-targets: Await the result of fetch_message() (#39)
* Await the result of fetch_message() * Apply black formatting
This commit is contained in:
parent
bf59634898
commit
3a0230259a
3 changed files with 30 additions and 30 deletions
|
@ -43,8 +43,8 @@ class Meme(Cog):
|
|||
)
|
||||
else:
|
||||
if user is None:
|
||||
user = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
user = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
|
||||
celsius = random.randint(15, 100)
|
||||
|
@ -72,8 +72,8 @@ class Meme(Cog):
|
|||
)
|
||||
else:
|
||||
if user is None:
|
||||
user = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
user = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
celsius = random.randint(-50, 15)
|
||||
fahrenheit = self.c_to_f(celsius)
|
||||
|
@ -92,8 +92,8 @@ class Meme(Cog):
|
|||
await ctx.send(f"No stars for you, {ctx.author.mention}!")
|
||||
else:
|
||||
if user is None:
|
||||
user = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
user = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
await ctx.send(f"{user.mention} gets a :star:, yay!")
|
||||
|
||||
|
@ -107,8 +107,8 @@ class Meme(Cog):
|
|||
await ctx.send(f"{ctx.author.mention}, you can't reward yourself.")
|
||||
else:
|
||||
if user is None:
|
||||
user = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
user = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
embed = discord.Embed(
|
||||
title="ReSwitched Silver™!",
|
||||
|
@ -183,8 +183,8 @@ class Meme(Cog):
|
|||
await ctx.reply("https://tenor.com/view/bonk-gif-26414884")
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
if target == ctx.author:
|
||||
if target.id == 181627658520625152:
|
||||
|
|
|
@ -46,8 +46,8 @@ class Mod(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
# Hedge-proofing the code
|
||||
if target == ctx.author:
|
||||
|
@ -140,8 +140,8 @@ class Mod(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
# Hedge-proofing the code
|
||||
if target == ctx.author:
|
||||
|
@ -210,8 +210,8 @@ class Mod(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
# Hedge-proofing the code
|
||||
if target == ctx.author:
|
||||
|
@ -282,8 +282,8 @@ class Mod(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
# Hedge-proofing the code
|
||||
if target == ctx.author:
|
||||
|
@ -540,8 +540,8 @@ class Mod(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
|
||||
log_channel = self.bot.get_channel(self.bot.config.modlog_channel)
|
||||
|
@ -579,8 +579,8 @@ class Mod(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
|
||||
log_channel = self.bot.get_channel(self.bot.config.modlog_channel)
|
||||
|
@ -625,8 +625,8 @@ class Mod(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
# Hedge-proofing the code
|
||||
if target == ctx.author:
|
||||
|
@ -779,8 +779,8 @@ class Mod(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
|
||||
try:
|
||||
|
|
|
@ -32,8 +32,8 @@ class ModTimed(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
# Hedge-proofing the code
|
||||
if target == ctx.author:
|
||||
|
@ -108,8 +108,8 @@ class ModTimed(Cog):
|
|||
)
|
||||
else:
|
||||
if target is None:
|
||||
target = ctx.channel.fetch_message(
|
||||
ctx.message.reference.message_id
|
||||
target = (
|
||||
await ctx.channel.fetch_message(ctx.message.reference.message_id)
|
||||
).author
|
||||
# Hedge-proofing the code
|
||||
if target == ctx.author:
|
||||
|
|
Loading…
Reference in a new issue