#PartialMessageable has no attribute 'permissions_for'

1 messages · Page 1 of 1 (latest)

proper elbow
#

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.

proper elbow
#

running it in a docker container, default pip libraries plus

py-cord[speed]==2.3.2
redis
aioredis
#

Welp

#

Im an idiot

#

i didnt have the members intent

open totem
#

Does it work after adding the members intent?

proper elbow
#

Yep

open totem
#

Cool

#

.close

zealous oracleBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @pine swallow.