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

SlashCommandOptionType.user doesn't work #1120

Closed
3 tasks done
s-fabian opened this issue Mar 5, 2022 · 4 comments
Closed
3 tasks done

SlashCommandOptionType.user doesn't work #1120

s-fabian opened this issue Mar 5, 2022 · 4 comments
Labels
unconfirmed bug A bug report that needs triaging

Comments

@s-fabian
Copy link

s-fabian commented Mar 5, 2022

Summary

SlashCommandOptionType.user doesn't work

Reproduction Steps

I tried to make a slash command containing the SlashCommandOptionType.user type, and there it started making trouble. I've tried Option(pycord.Member) too, with exact the same result.

Minimal Reproducible Code

@bot.slash_command(name="kick", guild_ids=[...])
async def command(ctx, member: pycord.SlashCommandOptionType.user):
    pass

Expected Results

The bot starts

Actual Results

Traceback (most recent call last):
File "/var/global/justmorebot/main.py", line 383, in
async def kick_user_command(interaction: pycord.Interaction, member: pycord.SlashCommandOptionType.user):
File "/home/heroclay/.local/lib/python3.8/site-packages/discord/bot.py", line 822, in decorator
result = command(**kwargs)(func)
File "/home/heroclay/.local/lib/python3.8/site-packages/discord/commands/core.py", line 1457, in decorator
return cls(func, **attrs)
File "/home/heroclay/.local/lib/python3.8/site-packages/discord/commands/core.py", line 590, in init
self.options: List[Option] = self._parse_options(params)
File "/home/heroclay/.local/lib/python3.8/site-packages/discord/commands/core.py", line 638, in _parse_options
option = Option(option, "No description provided")
File "/home/heroclay/.local/lib/python3.8/site-packages/discord/commands/options.py", line 124, in init
_type = SlashCommandOptionType.from_datatype(input_type)
File "/home/heroclay/.local/lib/python3.8/site-packages/discord/enums.py", line 654, in from_datatype
if datatype.name in ["Member", "User"]:
AttributeError: 'str' object has no attribute 'name'

Intents

guild_reactions, messages, bans, guilds

System Information

  • Python v3.8.10-final
  • py-cord v2.0.0-beta
    • py-cord pkg_resources: v2.0.0b4
  • aiohttp v3.7.4.post0
  • system info: Linux 5.4.0 #1 SMP Thu Apr 22 16:18:59 MSK 2021

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

@s-fabian s-fabian added the unconfirmed bug A bug report that needs triaging label Mar 5, 2022
@EmreTech
Copy link
Contributor

EmreTech commented Mar 5, 2022

Sounds like a problem that will be fixed with #863.

@s-fabian
Copy link
Author

s-fabian commented Mar 5, 2022

Ok thanks!

@s-fabian s-fabian closed this as completed Mar 5, 2022
@Dorukyum Dorukyum reopened this Mar 5, 2022
@Dorukyum
Copy link
Member

Dorukyum commented Mar 5, 2022

We shouldn't close issues until they are solved to be able to track them.

@Dorukyum
Copy link
Member

Dorukyum commented Mar 6, 2022

I can't reproduce this with beta 4.

@Dorukyum Dorukyum closed this as completed Apr 9, 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