Skip to content

permissions_for returning wrong permissions #2281

Closed
@Snawe

Description

@Snawe

Summary

permissions_for returning wrong permissions

Reproduction Steps

When you use channel.permissions_for, and you remove the "View Channel" permission, it still returns true.

NOTE:

  • Code below works with v2.4.1
  • But does not work with py-cord-dev-2.5.0rc5

Minimal Reproducible Code

I created a cog with:

    @slash_command()
    async def test_perm(self, ctx: discord.ApplicationContext):
        member = ctx.guild.get_member(self.bot.user.id)
        perm = ctx.channel.permissions_for(member)
        await ctx.response.send_message("🚫" if not perm.view_channel else "✅")

Expected Results

🚫if "View Channel" permission is denied. Else ✅

Actual Results

With py-cord-dev-2.5.0rc5: Always ✅
With py-cord 2.4.1: 🚫 or ✅, depending on the actual permission set

Intents

default

System Information

  • Python v3.9.4-final
  • py-cord-dev v2.5.None-candidate
    • py-cord-dev pkg_resources: v2.5.0rc5
  • aiohttp v3.8.3

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingon hold

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions