diff options
| author | 2021-05-10 09:35:48 -0400 | |
|---|---|---|
| committer | 2021-05-10 09:35:48 -0400 | |
| commit | b17a60a83edc98405e75ae84de23bbd1c7f4bf6c (patch) | |
| tree | 679740eeaaec9edab52c479636b26201f7d8a4db | |
| parent | chore: ctx.message.author -> ctx.author (diff) | |
chore: Use ctx instead of ctx.channel
| -rw-r--r-- | bot/exts/easter/egghead_quiz.py | 2 | ||||
| -rw-r--r-- | bot/exts/evergreen/error_handler.py | 5 | ||||
| -rw-r--r-- | bot/exts/evergreen/snakes/_snakes_cog.py | 2 | ||||
| -rw-r--r-- | bot/exts/evergreen/wolfram.py | 6 | 
4 files changed, 6 insertions, 9 deletions
| diff --git a/bot/exts/easter/egghead_quiz.py b/bot/exts/easter/egghead_quiz.py index 59c1f6f8..b6b1593d 100644 --- a/bot/exts/easter/egghead_quiz.py +++ b/bot/exts/easter/egghead_quiz.py @@ -64,7 +64,7 @@ class EggheadQuiz(commands.Cog):          del self.quiz_messages[msg.id] -        msg = await ctx.channel.fetch_message(msg.id)  # Refreshes message +        msg = await ctx.fetch_message(msg.id)  # Refreshes message          total_no = sum([len(await r.users().flatten()) for r in msg.reactions]) - len(valid_emojis)  # - bot's reactions diff --git a/bot/exts/evergreen/error_handler.py b/bot/exts/evergreen/error_handler.py index faaf1386..de8e53d0 100644 --- a/bot/exts/evergreen/error_handler.py +++ b/bot/exts/evergreen/error_handler.py @@ -125,10 +125,7 @@ class CommandErrorHandler(commands.Cog):              scope.set_extra("full_message", ctx.message.content)              if ctx.guild is not None: -                scope.set_extra( -                    "jump_to", -                    f"https://discordapp.com/channels/{ctx.guild.id}/{ctx.channel.id}/{ctx.message.id}" -                ) +                scope.set_extra("jump_to", ctx.message.jump_url)              log.exception(f"Unhandled command error: {str(error)}", exc_info=error) diff --git a/bot/exts/evergreen/snakes/_snakes_cog.py b/bot/exts/evergreen/snakes/_snakes_cog.py index b844960a..c50b23c5 100644 --- a/bot/exts/evergreen/snakes/_snakes_cog.py +++ b/bot/exts/evergreen/snakes/_snakes_cog.py @@ -1052,7 +1052,7 @@ class Snakes(Cog):                  # Get a random message from the users history                  messages = [] -                async for message in ctx.channel.history(limit=500).filter( +                async for message in ctx.history(limit=500).filter(                          lambda msg: msg.author == ctx.author  # Message was sent by author.                  ):                      messages.append(message.content) diff --git a/bot/exts/evergreen/wolfram.py b/bot/exts/evergreen/wolfram.py index 3cc12c03..ca7d8454 100644 --- a/bot/exts/evergreen/wolfram.py +++ b/bot/exts/evergreen/wolfram.py @@ -105,7 +105,7 @@ def custom_cooldown(*ignore: List[int]) -> Callable:  async def get_pod_pages(ctx: Context, bot: Bot, query: str) -> Optional[List[Tuple]]:      """Get the Wolfram API pod pages for the provided query.""" -    async with ctx.channel.typing(): +    async with ctx.typing():          url_str = parse.urlencode({              "input": query,              "appid": APPID, @@ -180,7 +180,7 @@ class Wolfram(Cog):          query = QUERY.format(request="simple", data=url_str)          # Give feedback that the bot is working. -        async with ctx.channel.typing(): +        async with ctx.typing():              async with self.bot.http_session.get(query) as response:                  status = response.status                  image_bytes = await response.read() @@ -263,7 +263,7 @@ class Wolfram(Cog):          query = QUERY.format(request="result", data=url_str)          # Give feedback that the bot is working. -        async with ctx.channel.typing(): +        async with ctx.typing():              async with self.bot.http_session.get(query) as response:                  status = response.status                  response_text = await response.text() | 
