Hi so I need to create a discord bot in python that stores a specific users sent messages in a seperate channels. Basically like message logs but its just for one user and every message they sent deleted or not If anyone could show me how to do that it would mean ALOT
While I agree with Elitezen's comment, the answer is quite simple.
import discord
from discord.ext import commands
client = commands.Bot(command_prefix=<YOUR PREFIX>)
@client.event
async def on_message(message):
if message.author.id == <ID OF USER>:
with open("log.txt","a") as f:
f.write(message.content + "\n")
client.run(TOKEN)