mirror of
https://github.com/kaaninchen/Gleiswechsel.git
synced 2026-07-21 19:52:47 +00:00
a lot
i forgot to do commits, how unprofessional... i restructured the bot and made the /info and /umstieg command. Bot's almost done, the only thing missing now is the loop
This commit is contained in:
@@ -1,12 +1,34 @@
|
||||
import discord
|
||||
import random
|
||||
from discord.ext import tasks
|
||||
from config import config
|
||||
from src.state import rename_vc
|
||||
from src.commands import setup_commands
|
||||
from src.embeds import build_error_embed
|
||||
from src.data.status import discord_status
|
||||
|
||||
|
||||
bot = discord.Bot(intents=discord.Intents.all())
|
||||
setup_commands(bot)
|
||||
|
||||
@tasks.loop(minutes=1)
|
||||
async def change_status():
|
||||
status = random.choice(discord_status)
|
||||
print(status)
|
||||
await bot.change_presence(activity=discord.Game(name=status))
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
await bot.change_presence(activity=discord.Game(name = "Casino"))
|
||||
print(f"{bot.user} ist online")
|
||||
if not change_status.is_running():
|
||||
change_status.start()
|
||||
await rename_vc(bot)
|
||||
|
||||
@bot.event
|
||||
async def on_application_command_error(ctx, error):
|
||||
embed = build_error_embed(f"Ein Fehler ist aufgetreten: {error}")
|
||||
await ctx.respond(embed=embed)
|
||||
|
||||
|
||||
try:
|
||||
bot.run(config['token'])
|
||||
|
||||
Reference in New Issue
Block a user