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

slash_options.py example does not work #1085

Closed
3 tasks done
Ahsoka opened this issue Feb 27, 2022 · 2 comments
Closed
3 tasks done

slash_options.py example does not work #1085

Ahsoka opened this issue Feb 27, 2022 · 2 comments
Labels
unconfirmed bug A bug report that needs triaging

Comments

@Ahsoka
Copy link
Contributor

Ahsoka commented Feb 27, 2022

Summary

The slash_options.py file does not work and errors out upon running the file.

Reproduction Steps

Just run slash_options.py and it errors out.

Expected Results

It should work.

Actual Results

Traceback (most recent call last):
  File "slash_options.py", line 25, in <module>
    channel: Option([discord.TextChannel, discord.VoiceChannel], "Select a channel")
  File "C:\ProgramData\Anaconda3\lib\site-packages\discord\commands\options.py", line 75, in __init__
    _type = SlashCommandOptionType.from_datatype(input_type)
  File "C:\ProgramData\Anaconda3\lib\site-packages\discord\enums.py", line 657, in from_datatype
    if datatype.__name__ in ["Member", "User"]:
AttributeError: 'list' object has no attribute '__name__'

Intents

Intents are not relevant here

System Information

Python Version: 3.8.11
OS: Windows 10
Pycord Version: 2.0.0b4

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 initially discovered in #991 in this comment. I am making an issue about it.

@Ahsoka Ahsoka added the unconfirmed bug A bug report that needs triaging label Feb 27, 2022
@jontobonto
Copy link

See #1054, there's an error in the examples. You have to use () instead of [] since the source is checking for a tuple, not a list.

@Dorukyum
Copy link
Member

Dorukyum commented Mar 8, 2022

I'm closing this as #991 is about the same issue.

@Dorukyum Dorukyum closed this as completed Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug A bug report that needs triaging
Projects
None yet
Development

No branches or pull requests

3 participants