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

Option([XX, YY]) doesn't work #1233

Closed
3 tasks done
MagicalBomb opened this issue Apr 8, 2022 · 1 comment
Closed
3 tasks done

Option([XX, YY]) doesn't work #1233

MagicalBomb opened this issue Apr 8, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@MagicalBomb
Copy link

MagicalBomb commented Apr 8, 2022

Summary

Option([XX, YY]) doesn't work

Reproduction Steps

launch minimal code, it raises exception directly

Minimal Reproducible Code

import discord
from discord.commands import slash_command, Option


bot = discord.Bot()

from discord.commands import slash_command

@slash_command()
async def test(ctx, channel: Option([discord.TextChannel, discord.VoiceChannel])):
    ctx.respond("Hello")


bot.run("XXX")

Expected Results

bot launch normally

Actual Results

bot raised a exception, and program exit with error.

Traceback (most recent call last):
  File "/Users/XXX/Desktop/test.py", line 14, in <module>
    ctx.respond("Hello")
  File "/Users/XXX/Desktop/venv/lib/python3.10/site-packages/discord/commands/options.py", line 132, in __init__
    _type = SlashCommandOptionType.from_datatype(input_type)
  File "/Users/XXX/Desktop/venv/lib/python3.10/site-packages/discord/enums.py", line 653, in from_datatype
    if datatype.__name__ in ["Member", "User"]:
AttributeError: 'list' object has no attribute '__name__'. Did you mean: '__ne__'?

Intents

None

System Information

  • Python v3.10.1-final
  • py-cord v2.0.0-beta
    • py-cord pkg_resources: v2.0.0b5
  • aiohttp v3.7.4.post0
  • system info: Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:07 PST 2021; root:xnu-7195.141.14~1/RELEASE_X86_64

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

@MagicalBomb MagicalBomb added the unconfirmed bug A bug report that needs triaging label Apr 8, 2022
@Dorukyum
Copy link
Member

Dorukyum commented Apr 8, 2022

Duplicate of #991.

@Dorukyum Dorukyum closed this as completed Apr 8, 2022
@Middledot Middledot added duplicate This issue or pull request already exists and removed unconfirmed bug A bug report that needs triaging labels Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants