-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (22 loc) · 948 Bytes
/
Copy pathmain.py
File metadata and controls
27 lines (22 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import discord
import python
TOKEN = 'DISCORD_TOKEN'
# Dprt muss der Discord Bot Code rein
@bot.event
async def on_ready():
print(f'Eingelogt in {bot.user.name}#{bot.user.id}')
try:
synced = await bot.tree.sync(guild=discord.Object(id=SERVER_ID))
print(f'Erfolgreich {len(synced)} Bot Commands Geladen')
guild = bot.get_guild(int(SERVER_ID))
for i in range(1, 4):
role_name = f"Warn {i}"
if not discord.utils.get(guild.roles, name=role_name):
await guild.create_role(name=role_name)
print("Der Bot hat sich Eingelogt")
# Start the activity cycling task
if not change_status.is_running():
change_status.start()
except Exception as e:
print(f'Ein Fehler ist Entstanden beim Laden der Commands: {e}')
# Dies macht das der Bot Code Fehler Erkennt das er angezeigt wird im Terminal