first simple run
This commit is contained in:
parent
6bebf682de
commit
942b2e8eb9
1
.env
Normal file
1
.env
Normal file
@ -0,0 +1 @@
|
||||
DISCORD_TOKEN=MTM1NzQyNzkxNTY1ODIzMjA1OA.GmeAHt.LJB9dYfjccWYbfTyytbzc7yOGxrLrrYCFTATqo
|
||||
30
main.py
Normal file
30
main.py
Normal 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"))
|
||||
Loading…
x
Reference in New Issue
Block a user