first simple run

This commit is contained in:
Marco Kohn 2025-04-04 21:52:51 +02:00
parent 6bebf682de
commit 942b2e8eb9
2 changed files with 31 additions and 0 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
DISCORD_TOKEN=MTM1NzQyNzkxNTY1ODIzMjA1OA.GmeAHt.LJB9dYfjccWYbfTyytbzc7yOGxrLrrYCFTATqo

30
main.py Normal file
View File

@ -0,0 +1,30 @@
import discord
import os
from dotenv import load_dotenv
intents = discord.Intents.default()
intents.message_content = True # NOQA
bot = discord.Bot(intents=intents)
@bot.event
async def on_ready():
print(f"{bot.user} ist online")
@bot.event
async def on_message(msg):
if msg.author.bot:
return
await msg.channel.send("Du stinkst")
@bot.event
async def on_message_delete(msg):
await msg.channel.send(f"Eine Nachricht von {msg.author} wurde gelöscht: {msg.content}")
load_dotenv()
bot.run(os.getenv("DISCORD_TOKEN"))