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

Code 0 Although Not Rate Limited #475

Closed BigChungus888 closed 1 year ago

BigChungus888 commented 1 year ago

Summary

Was expecting to send a message, but got error code 0. However, the user account is not rate limited as I can still send messages properly. I stopped the bot for a day, but the error still continues.

Reproduction Steps

  1. Fetch an author object.
  2. Create a DM channel.
  3. Send a message with a file.
author = await bot.fetch_user(author_id)
channel = await author.create_dm()

await channel.send(some_content, file=discord.File(file)

Code

No response

Expected Results

Message sent

Actual Results

ERROR:asyncio:_ClientEventTask exception was never retrieved
future: <ClientEventTask state=finished event=on_message coro=<function on_message at 0x7f89e0349670> exception=AttributeError("'str' object has no attribute '__traceback__'")>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/discord/client.py", line 301, in _run_event
    await coro(*args, **kwargs)
  File "<ipython-input-5-f6c5c8aa25f4>", line 580, in on_message
    await channel.send(fine_tune(random.choice(starter_phrases)), file=discord.File(recruit_banner))
  File "/usr/local/lib/python3.9/dist-packages/discord/abc.py", line 1041, in send
    data = await state.http.send_files(channel.id, files=[file], allowed_mentions=allowed_mentions,
  File "/usr/local/lib/python3.9/dist-packages/discord/http.py", line 302, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 0)

System Information

discord.py-self==1.9.2 python 3.9

Checklist

Additional Information

No response

dolfies commented 1 year ago

This is a captcha. An API for handling them is exposed in the current alpha (installable from the master branch).