aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-05-07 12:55:16 -0700
committerGravatar MarkKoz <[email protected]>2020-06-13 11:21:07 -0700
commit2694cbff786154fb8ba1211b0954f12312b71016 (patch)
treecd4c1b022ce0a923e85a941a42309f9b4644a15c
parentCode block: fix error retrieving a deleted instructions message (diff)
Code block: refactor `send_guide_embed`
* Rename to `send_instructions` to be consistent with the use of "instructions" rather than "guide" elsewhere * Rename the `description` parameter to `instructions`
-rw-r--r--bot/cogs/codeblock/cog.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/cogs/codeblock/cog.py b/bot/cogs/codeblock/cog.py
index f64ac8c45..38daa7974 100644
--- a/bot/cogs/codeblock/cog.py
+++ b/bot/cogs/codeblock/cog.py
@@ -76,15 +76,15 @@ class CodeBlockCog(Cog, name="Code Block"):
or channel.id in self.channel_whitelist
)
- async def send_guide_embed(self, message: discord.Message, description: str) -> None:
+ async def send_instructions(self, message: discord.Message, instructions: str) -> None:
"""
- Send an embed with `description` as a guide for an improperly formatted `message`.
+ Send an embed with `instructions` on fixing an incorrect code block in a `message`.
The embed will be deleted automatically after 5 minutes.
"""
log.trace("Sending an embed with code block formatting instructions.")
- embed = Embed(description=description)
+ embed = Embed(description=instructions)
bot_message = await message.channel.send(f"Hey {message.author.mention}!", embed=embed)
self.codeblock_message_ids[message.id] = bot_message.id
@@ -124,7 +124,7 @@ class CodeBlockCog(Cog, name="Code Block"):
instructions = get_instructions(msg.content)
if instructions:
- await self.send_guide_embed(msg, instructions)
+ await self.send_instructions(msg, instructions)
if msg.channel.id not in self.channel_whitelist:
log.trace(f"Adding #{msg.channel} to the channel cooldowns.")