dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
665 stars 155 forks source link

Commands don't work in dev version #506

Closed Vazgen005 closed 1 year ago

Vazgen005 commented 1 year ago

Summary

title

Reproduction Steps

ping

Code

import discord
from discord.ext import commands

# region config
TOKEN = "TOKEN"
# endregion

bot = commands.Bot(command_prefix='>', self_bot=True)

@bot.command()
async def ping(ctx):
    await ctx.send('pong')

bot.run(TOKEN)

Expected Results

pong

Actual Results

➤ py .\test.py        
2023-05-10 02:11:40 INFO     discord.client Logging in using static token.
2023-05-10 02:11:40 INFO     discord.http Found user agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36, build number 196590.
2023-05-10 02:11:41 INFO     discord.gateway Connected to Gateway (Session ID: db91536e0269f2ea4e9a4f72c3ec8a18).
2023-05-10 02:11:48 ERROR    discord.ext.commands.bot Ignoring exception in command ping
Traceback (most recent call last):
  File "C:\Users\vaz05\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\core.py", line 236, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vaz05\Desktop\code\Python\selfbot-v2\test.py", line 12, in ping
    await ctx.send('pong')
  File "C:\Users\vaz05\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\abc.py", line 1821, in send
    with handle_message_parameters(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vaz05\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\http.py", line 331, in handle_message_parameters
    to_upload = [file for file in files if isinstance(file, File)]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '_MissingSentinel' object is not iterable

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

Traceback (most recent call last):
  File "C:\Users\vaz05\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\bot.py", line 1169, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\vaz05\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\core.py", line 1020, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vaz05\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\core.py", line 245, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: '_MissingSentinel' object is not iterable

System Information

- Python v3.11.2-final
- discord.py-self v2.1.0-alpha
    - discord.py-self metadata: v2.1.0a4694+geec5f634
- aiohttp v3.8.4
- system info: Windows 10 10.0.22621

Checklist

Additional Information

No response

dolfies commented 1 year ago

Oopsies 😆