I was wondering if there was a way to log every single message ever sent in one specific discord server and log them to a txt file. I have this code so far, but I think it only logs new messages being sent. I need it to log all.
@bot.event
async def on_message(message):
await bot.process_commands(message)
if (message.channel.id == '655864692333477926'):
sentmsg2 = str(message.content)
f=open("speclog.txt", "a+")
for i in range(1):
f.write(sentmsg2 + "
")
question from:
https://stackoverflow.com/questions/65600927/log-all-messages-ever-sent-in-a-specific-channel-discord-py 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…