Browse Source

Messages: Remove ctx typing

master
Daniel Skýpala 9 months ago
parent
commit
ca2b2c45a4
  1. 4
      hrochobot/cogs/messages.py

4
hrochobot/cogs/messages.py

@ -13,7 +13,7 @@ class Messages(commands.Cog):
self.bot = bot self.bot = bot
@discord.message_command() @discord.message_command()
async def forward(self, ctx: discord.Interaction, message: discord.Message): async def forward(self, ctx, message: discord.Message):
messages_json = data.load_guild_data(ctx.guild.id, MESSAGES_JSON) messages_json = data.load_guild_data(ctx.guild.id, MESSAGES_JSON)
if "forward_channel" not in messages_json: if "forward_channel" not in messages_json:
return await ctx.respond(f"Forwarding channel not set.", ephemeral=True) return await ctx.respond(f"Forwarding channel not set.", ephemeral=True)
@ -26,7 +26,7 @@ class Messages(commands.Cog):
@discord.slash_command(description="Sets channel for forwarding.") @discord.slash_command(description="Sets channel for forwarding.")
@discord.option("channel", discord.TextChannel, description="Channel for forwarding.") @discord.option("channel", discord.TextChannel, description="Channel for forwarding.")
@discord.default_permissions(administrator=True) @discord.default_permissions(administrator=True)
async def set_forward_channel(self, ctx: discord.Interaction, channel: discord.TextChannel): async def set_forward_channel(self, ctx, channel: discord.TextChannel):
messages_json = data.load_guild_data(ctx.guild.id, MESSAGES_JSON) messages_json = data.load_guild_data(ctx.guild.id, MESSAGES_JSON)
messages_json["forward_channel"] = channel.id messages_json["forward_channel"] = channel.id
data.dump_guild_data(ctx.guild.id, MESSAGES_JSON, messages_json) data.dump_guild_data(ctx.guild.id, MESSAGES_JSON, messages_json)

Loading…
Cancel
Save