Get .txt file from discord message

  Kiến thức lập trình

When someones sends a message over 4,000 characters, the message gets sent into a .txt file instead, making it impossible to get the message content with message.content, i’m therefore looking for a way to read the .txt file

bot.event
async def on_message(message):
    for attachment in message.attachments:
        print("X")
        await attachment.save(attachment.filename)

This says index out of range, basically no attachments in the message when there is a .txt file

xxxxxxxxxxxxxxxxxxxxxx

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT