I want to make a bot that copies messages from a discord server and then pastes them into the Minecraft chat. I'm not talking about rcon.
I copied some code that takes the last message and puts it in a text file:
async def copy(ctx):
with open("file.txt", "w") as f:
async for message in ctx.history(limit=1000):
f.write(message.content + "\n")
But I can't find this text file. I've tried putting it in the same folder with main.py and replacing "file.txt" with a full path to the file but it still won't work.
If I manage to get this whole "copy message into txt/variable" thing I should be able to finish the "paste stuff into chat" thing.
Please help me I'm stupid.