Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid permissions #1283

Closed
3 tasks done
solaluset opened this issue Apr 20, 2022 · 3 comments · Fixed by #1365
Closed
3 tasks done

Invalid permissions #1283

solaluset opened this issue Apr 20, 2022 · 3 comments · Fixed by #1365
Labels
bug Something isn't working

Comments

@solaluset
Copy link
Contributor

Summary

Pycord gives invalid permissions

Reproduction Steps

  1. Make a slash command which takes a channel as argument.
  2. Invoke it with a channel where the bot doesn't have permissions to send messages.
  3. Permissions are not correct

Minimal Reproducible Code

@bot.slash_command()
async def test(ctx, channel: discord.Option(discord.TextChannel)):
    print(
        "Test result: ",
        channel.permissions_for(ctx.me)
        == ctx.guild.get_channel(channel.id).permissions_for(ctx.me),
    )

Expected Results

Test result: True

Actual Results

Test result: False
(permissions got from channel argument are not valid)

Intents

none

System Information

  • Python v3.9.9-final
  • py-cord v2.0.0-beta
    • py-cord pkg_resources: v2.0.0b7
  • aiohttp v3.7.4.post0
  • system info: Windows 10 10.0.17763

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

This was discussed in #help-1
https://discord.com/channels/881207955029110855/881309496385884180/966397457187606558

@solaluset solaluset added the unconfirmed bug A bug report that needs triaging label Apr 20, 2022
@plun1331
Copy link
Member

Without intents, the permissions in the cached channel would not be up-to-date, causing such an issue

@krittick
Copy link
Contributor

Without intents, the permissions in the cached channel would not be up-to-date, causing such an issue

I can reproduce the issue myself with Intents.all().

@Dorukyum Dorukyum added bug Something isn't working and removed unconfirmed bug A bug report that needs triaging labels Apr 24, 2022
@plun1331
Copy link
Member

The way app command arguments are parsed may be relevant, including the data sent by discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants