I was doing some research on Discord's capabilities today, and then I noticed that the "upload as file" option is given when a message is more than 2000 characters long.
The number plays a role here, but my statement can also be wrong, the fact is that some things are posted only as a link and or then not sent at all if I raise >2000
.
Here now the problem:
I am requesting data from Genius for a lyrics command. I already have some kind of override built in for when len(data["lyrics"])
is greater than 2000
"characters", that should be Discord's limit after all, otherwise the bot wouldn't be able to process the embed I am trying to send.
How can I manage that lyrics >2000
are sent as a file?
Relevant code:
if len(data["lyrics"]) > 2000:
return await ctx.send(f"<{data['links']['genius']}>"))
- This is the normal request, it works too, but it just throws out the link.
I then tried to send this via
discord.File
with the corresponding piece of code above, does not work. (Something likefile=discord.File(data)
was tried too!) - Something like
ctx.file.send
does not work in this case either
The following posts were viewed:
- Uploading a file in a embed discord.py (not a image)
- Discord.py - Sending a text file on DM
- Discord.py Bot sending file to Discord Channel
- Python discord.py ways to split output to bypass 2000 character limit
What I want my bot to do if data["lyrics"] > 2000
: