diff options
author | 2022-03-31 20:40:34 +0100 | |
---|---|---|
committer | 2022-04-18 17:44:41 +0100 | |
commit | f14bf002bb3070657ae6fdd4d64aac5769a2d569 (patch) | |
tree | dd5ca5283c8a91c4408455fe82a965e5ce8fb5f3 | |
parent | Use BotBase from bot-core (diff) |
Discord.py breaking changes
bot.http.send_message and edit_message now require a context manager to handle params.
tasks.Loop no longer accepts a loop param on its init.
-rw-r--r-- | bot/exts/help_channels/_cog.py | 15 | ||||
-rw-r--r-- | bot/exts/moderation/silence.py | 1 |
2 files changed, 9 insertions, 7 deletions
diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py index 2b2a5831f..c6b66894b 100644 --- a/bot/exts/help_channels/_cog.py +++ b/bot/exts/help_channels/_cog.py @@ -9,6 +9,7 @@ import discord import discord.abc from botcore.utils import members, scheduling from discord.ext import commands +from discord.http import handle_message_parameters from bot import constants from bot.bot import Bot @@ -563,18 +564,20 @@ class HelpChannels(commands.Cog): if self.dynamic_message is not None: try: log.trace("Help channels have changed, dynamic message has been edited.") - await self.bot.http.edit_message( - constants.Channels.how_to_get_help, self.dynamic_message, content=available_channels - ) + with handle_message_parameters(available_channels) as params: + await self.bot.http.edit_message( + constants.Channels.how_to_get_help, + self.dynamic_message, + params=params, + ) except discord.NotFound: pass else: return log.trace("Dynamic message could not be edited or found. Creating a new one.") - new_dynamic_message = await self.bot.http.send_message( - constants.Channels.how_to_get_help, available_channels - ) + with handle_message_parameters(available_channels) as params: + new_dynamic_message = await self.bot.http.send_message(constants.Channels.how_to_get_help, params=params) self.dynamic_message = new_dynamic_message["id"] await _caches.dynamic_message.set("message_id", self.dynamic_message) diff --git a/bot/exts/moderation/silence.py b/bot/exts/moderation/silence.py index 6173b4492..b2c3b7087 100644 --- a/bot/exts/moderation/silence.py +++ b/bot/exts/moderation/silence.py @@ -55,7 +55,6 @@ class SilenceNotifier(tasks.Loop): hours=0, count=None, reconnect=True, - loop=None, time=MISSING ) self._silenced_channels = {} |