-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (26 loc) · 712 Bytes
/
main.py
File metadata and controls
33 lines (26 loc) · 712 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
28
29
30
31
32
33
import os
import sys
import traceback
from dotenv import load_dotenv
import disnake
from disnake.ext import commands
load_dotenv()
BOT_TOKEN = os.getenv("BOT_TOKEN")
bot = commands.InteractionBot(
intents=disnake.Intents.default(),
reload=True,
)
# noinspection PyBroadException
try:
bot.load_extension("cogs.radio")
except Exception:
print("Failed to load extension radio", file=sys.stderr)
traceback.print_exc()
@bot.event
async def on_ready():
await bot.change_presence(
activity=disnake.Activity(type=disnake.ActivityType.listening, name="/radio")
)
print(f"logged in as\n{bot.user.name}\n{bot.user.id}\n----")
if __name__ == "__main__":
bot.run(BOT_TOKEN)