SakuraProject / rt-bot

RTの無料版であるFree-RTのBotソースコード。
BSD 4-Clause "Original" or "Old" License
12 stars 6 forks source link

cogロード時にでるエラー #132

Closed yaakiyu closed 2 years ago

yaakiyu commented 2 years ago
Traceback (most recent call last):
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 916, 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\Yukiaya\rt-bot\cogs\serversafety\gban.py", line 64, in <module>
    class GlobalBan(commands.Cog, DataManager):
  File "c:\Users\Yukiaya\rt-bot\cogs\serversafety\gban.py", line 150, in GlobalBan
    async def check(self, ctx, *, user: Union[discord.User, discord.Object]):
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 764, in decorator
    result = hybrid_command(name=name, *args, with_app_command=with_app_command, **kwargs)(func)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 841, in decorator
    return HybridCommand(func, name=name, with_app_command=with_app_command, **attrs)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 482, in __init__
    HybridAppCommand(self) if self.with_app_command else None
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 291, in __init__
    params = replace_parameters(wrapped.params, wrapped.callback, signature)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 268, in replace_parameters
    param = replace_parameter(param, converter, callback, parameter, params)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 190, in replace_parameter
    app_commands.transformers.get_supported_annotation(converter)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\transformers.py", line 683, in get_supported_annotation
    raise TypeError(f'unsupported types given inside {annotation!r}')
TypeError: unsupported types given inside typing.Union[discord.user.User, discord.object.Object]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\Users\Yukiaya\rt-bot\cogs\serversafety\__init__.py", line 9, in setup
    await bot.load_extension(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 994, in load_extension
    await self._load_from_module_spec(spec, name)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 919, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.serversafety.gban' raised an error: TypeError: unsupported types given inside typing.Union[discord.user.User, discord.object.Object]

Traceback (most recent call last):
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 916, 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\Yukiaya\rt-bot\cogs\serversafety\moderation.py", line 9, in <module>
    class Moderation(commands.Cog):
  File "c:\Users\Yukiaya\rt-bot\cogs\serversafety\moderation.py", line 23, in Moderation
    async def ban(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 841, in decorator
    return HybridCommand(func, name=name, with_app_command=with_app_command, **attrs)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 482, in __init__
    HybridAppCommand(self) if self.with_app_command else None
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 295, in __init__
    super().__init__(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 517, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 398, in _extract_parameters_from_callback
    _populate_descriptions(result, descriptions)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 290, in _populate_descriptions
    raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: member

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\Users\Yukiaya\rt-bot\cogs\serversafety\__init__.py", line 9, in setup
    await bot.load_extension(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 994, in load_extension
    await self._load_from_module_spec(spec, name)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 919, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.serversafety.moderation' raised an error: TypeError: unknown parameter given: member

Traceback (most recent call last):
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 916, 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\Yukiaya\rt-bot\cogs\servertool\__init__.py", line 32, in <module>
    class ServerTool(commands.Cog):
  File "c:\Users\Yukiaya\rt-bot\cogs\servertool\__init__.py", line 54, in ServerTool
    async def permission(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 841, in decorator
    return HybridCommand(func, name=name, with_app_command=with_app_command, **attrs)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 482, in __init__
    HybridAppCommand(self) if self.with_app_command else None
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 291, in __init__
    params = replace_parameters(wrapped.params, wrapped.callback, signature)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 268, in replace_parameters
    param = replace_parameter(param, converter, callback, parameter, params)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 190, in replace_parameter
    app_commands.transformers.get_supported_annotation(converter)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\transformers.py", line 683, in get_supported_annotation
    raise TypeError(f'unsupported types given inside {annotation!r}')
TypeError: unsupported types given inside typing.Union[discord.member.Member, discord.role.Role, str]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\Users\Yukiaya\rt-bot\main.py", line 63, in on_ready
    await bot.load_extension(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 994, in load_extension
    await self._load_from_module_spec(spec, name)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 919, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.servertool' raised an error: TypeError: unsupported types given inside typing.Union[discord.member.Member, discord.role.Role, str]

Traceback (most recent call last):
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 916, 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\Yukiaya\rt-bot\cogs\serveruseful\level.py", line 57, in <module>
    class Level(commands.Cog):
  File "c:\Users\Yukiaya\rt-bot\cogs\serveruseful\level.py", line 260, in Level
    async def set(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 764, in decorator
    result = hybrid_command(name=name, *args, with_app_command=with_app_command, **kwargs)(func)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 841, in decorator
    return HybridCommand(func, name=name, with_app_command=with_app_command, **attrs)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 482, in __init__
    HybridAppCommand(self) if self.with_app_command else None
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 291, in __init__
    params = replace_parameters(wrapped.params, wrapped.callback, signature)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 268, in replace_parameters
    param = replace_parameter(param, converter, callback, parameter, params)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 190, in replace_parameter
    app_commands.transformers.get_supported_annotation(converter)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\transformers.py", line 683, in get_supported_annotation
    raise TypeError(f'unsupported types given inside {annotation!r}')
TypeError: unsupported types given inside typing.Union[discord.role.Role, discord.object.Object]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\Users\Yukiaya\rt-bot\cogs\serveruseful\__init__.py", line 9, in setup
    await bot.load_extension(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 994, in load_extension
    await self._load_from_module_spec(spec, name)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 919, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.serveruseful.level' raised an error: TypeError: unsupported types given inside typing.Union[discord.role.Role, discord.object.Object]

Traceback (most recent call last):
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 916, 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\Yukiaya\rt-bot\cogs\serveruseful\require_send.py", line 221, in <module>
    class RequireSend(commands.Cog, DataManager):
  File "c:\Users\Yukiaya\rt-bot\cogs\serveruseful\require_send.py", line 282, in RequireSend
    async def add(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 764, in decorator
    result = hybrid_command(name=name, *args, with_app_command=with_app_command, **kwargs)(func)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 841, in decorator
    return HybridCommand(func, name=name, with_app_command=with_app_command, **attrs)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 482, in __init__
    HybridAppCommand(self) if self.with_app_command else None
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 291, in __init__
    params = replace_parameters(wrapped.params, wrapped.callback, signature)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 268, in replace_parameters
    param = replace_parameter(param, converter, callback, parameter, params)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 190, in replace_parameter
    app_commands.transformers.get_supported_annotation(converter)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\transformers.py", line 675, in get_supported_annotation
    return (channel_transformer(*args, raw=None), default)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\transformers.py", line 556, in channel_transformer
    raise TypeError(f'Union type of channels must be entirely made up of channels') from None
TypeError: Union type of channels must be entirely made up of channels

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\Users\Yukiaya\rt-bot\cogs\serveruseful\__init__.py", line 9, in setup
    await bot.load_extension(
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 994, in load_extension
    await self._load_from_module_spec(spec, name)
  File "C:\Users\Yukiaya\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 919, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.serveruseful.require_send' raised an error: TypeError: Union type of channels must be entirely made up of channels
yaakiyu commented 2 years ago

時間がない 明日見る

yaakiyu commented 2 years ago

わかった 直す

yaakiyu commented 2 years ago

修正した。