I was converting my old bot to py-cord recently, and for some reason whenever I run a slash command and attempt to check permissions via ctx.channel.permissions_for(ctx.author) it says that permissions_for does not exist. For some reason ctx.channel is a PartialMessageable object, and im not quite sure why. I am using bridge.
This is the part of the cog causing issues:
# @commands.check(mods_can_change_settings)
@bridge.bridge_command(name="enable_gpt3",
description="Enable the GPT3 bot in a channel")
async def add_gpt3_channel(self, ctx: bridge.BridgeContext, channel: discord.TextChannel):
if not ctx.channel.permissions_for(ctx.author).administrator: <-- 'PartialMessageable' object has no attribute 'permissions_for'
return await ctx.respond("You don't have permission to change settings.")
key = f"gpt3bot_channels:{ctx.guild.id}"
if not await self.redis.sismember(key, channel.id):
Strange issue considering I have nearly exactly the same code in another bot and it works just fine.