Repository: Pycord-Development/pycord

Issue:
multiple-type arg option is beak
### Summary

Cannot set multiple type for arg in slash command

### Reproduction Steps

```python
@slash_command()
async def test(self, ctx, channel: Option([discord.TextChannel, discord.VoiceChannel])):
    print(channel)
```

### Minimal Reproducible Code

```python
Traceback (most recent call last):
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 705, in _load_from_module_spec
    spec.loader.exec_module(lib)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "c:\Users\Andrew\Documents\tuflya\cogs\sendmsg.py", line 8, in <module>
    class sendmsg(commands.Cog):
  File "c:\Users\Andrew\Documents\tuflya\cogs\sendmsg.py", line 14, in sendmsg
    channel: Option([discord.TextChannel, discord.VoiceChannel], "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u0430\u043d\u0430\u043b"),
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\options.py", line 72, in __init__
    _type = SlashCommandOptionType.from_datatype(input_type)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\enums.py", line 670, in from_datatype
    if datatype.__name__ in ["Member", "User"]:
AttributeError: 'list' object has no attribute '__name__'. Did you mean: '__ne__'?
```


### Expected Results

channel arg should accept both types

### Actual Results

can't use multiple-type in slash command

### Intents

default, members

### System Information

Python Version: 3.10
Pycord Version: 2.0.0b4

### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

_No response_


Discussion:
Try to pass a tuple of channel types, not a list of them.
I'm going to open a PR to accept lists of channel types.
Have you tried [SlashCommandOptionType](https://github.com/Pycord-Development/pycord/blob/master/discord/enums.py#L646).channel (for your use case)?

> Try to pass a tuple of channel types, not a list of them. I'm going to open a PR to accept lists of channel types.

So they should update their example 
https://github.com/Pycord-Development/pycord/blob/master/examples/app_commands/slash_options.py#L25

Resolving patch:
diff --git a/discord/commands/options.py b/discord/commands/options.py
--- a/discord/commands/options.py
+++ b/discord/commands/options.py
@@ -139,7 +139,7 @@ def __init__(self, input_type: Any, /, description: str = None, **kwargs) -> Non
                     input_type = SlashCommandOptionType.string
                 else:
                     if _type == SlashCommandOptionType.channel:
-                        if not isinstance(input_type, tuple):
+                        if not isinstance(input_type, list):
                             input_type = (input_type,)
                         for i in input_type:
                             if i.__name__ == "GuildChannel":


Test patch: