Compare commits
No commits in common. "0d894a06dd0e1cedda32ecd72570f41a6177b10b" and "a9a962825c1d09b238498163d7b158d1828b6659" have entirely different histories.
0d894a06dd
...
a9a962825c
24
main.py
24
main.py
@ -1,33 +1,29 @@
|
|||||||
import os
|
import os
|
||||||
import discord
|
import discord
|
||||||
from discord.commands import Option
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
intents.message_content = True # NOQA
|
intents.message_content = True # NOQA
|
||||||
|
|
||||||
bot = discord.Bot(intents=intents, debug_guilds=[889424923859230720])
|
bot = discord.Bot(intents=intents)
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
print(f"{bot.user} ist online")
|
print(f"{bot.user} ist online")
|
||||||
|
|
||||||
|
|
||||||
@bot.slash_command(description="Grüße einen User")
|
@bot.event
|
||||||
async def greet(ctx, user: Option(discord.User, "Der User, den du grüßen möchtest")):
|
async def on_message(msg):
|
||||||
await ctx.respond(f"Hallo {user.mention}")
|
if msg.author.bot:
|
||||||
|
return
|
||||||
|
|
||||||
|
await msg.channel.send("Du stinkst")
|
||||||
|
|
||||||
|
|
||||||
@bot.slash_command(description="Lass den Bot eine Nachricht senden")
|
@bot.event
|
||||||
async def say(
|
async def on_message_delete(msg):
|
||||||
ctx,
|
await msg.channel.send(f"Eine Nachricht von {msg.author} wurde gelöscht: {msg.content}")
|
||||||
text: Option(str, "Der Text, den du senden möchtest"),
|
|
||||||
channel: Option(discord.TextChannel, "Der Channel, in den du die Nachricht senden möchtest")
|
|
||||||
):
|
|
||||||
await channel.send(text)
|
|
||||||
await ctx.respond("Nachricht gesendet", ephemeral=True)
|
|
||||||
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
bot.run(os.getenv("DISCORD_TOKEN"))
|
bot.run(os.getenv("DISCORD_TOKEN"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user