In discord, one message is 2KB If you want to see the operation log on the bot, you may not be able to send it as a message.
Therefore, it is convenient to have it uploaded to the bot as a text file.
@client.event
async def on_message(message):
if message.content = 'log':
log = ''
#Assemble the log properly
for d in data:
log += d + '\n'
with StringIO(log) as bs:
await message.channel.send(file=discord.File(bs, 'log.txt'))
Recommended Posts