2025-04-04 21:52:51 +02:00
|
|
|
import os
|
2025-04-05 20:06:56 +00:00
|
|
|
import discord
|
2025-04-04 21:52:51 +02:00
|
|
|
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()
|
2025-04-05 20:21:17 +00:00
|
|
|
bot.run(os.getenv("DISCORD_TOKEN"))
|