cleanup / respect allergies
This commit is contained in:
@ -1,6 +1,3 @@
|
||||
#!/usr/bin/env python3.12
|
||||
# pylint: disable=bare-except, broad-exception-caught
|
||||
|
||||
import io
|
||||
import random
|
||||
import asyncio
|
||||
@ -45,6 +42,34 @@ class Owner(commands.Cog):
|
||||
return await ctx.respond("Too hot! (35°C maximum)")
|
||||
self._temperature = _temperature
|
||||
return await ctx.respond(f"As per your request, I have adjusted the temperature to {_temperature} °C.")
|
||||
|
||||
@bridge.bridge_command()
|
||||
@commands.is_owner()
|
||||
async def editmsg(self, ctx,
|
||||
msgid: str,
|
||||
*,
|
||||
newcontent: str
|
||||
) -> None:
|
||||
"""
|
||||
Edit a message previously sent by the bot
|
||||
|
||||
Args:
|
||||
ctx (Any): Discord context
|
||||
msgid (str): Should be an int, the message id to edit
|
||||
newcontent (str): Content to replace message with
|
||||
"""
|
||||
|
||||
try:
|
||||
message: Optional[discord.Message] = self.bot.get_message(int(msgid))
|
||||
if not message:
|
||||
await ctx.respond(f"**Failed:** Message {msgid} not found.",
|
||||
ephemeral=True)
|
||||
return None
|
||||
await message.edit(content=newcontent)
|
||||
await ctx.respond("**Done!**", ephemeral=True)
|
||||
except Exception as e:
|
||||
await ctx.respond(f"**Failed:** {str(e)}",
|
||||
ephemeral=True)
|
||||
|
||||
@bridge.bridge_command()
|
||||
@commands.is_owner()
|
||||
|
Reference in New Issue
Block a user