-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
42 lines (32 loc) · 1005 Bytes
/
main.py
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
34
35
36
37
38
39
40
41
42
import os
import pkgutil
import interactions
from dotenv import load_dotenv
from interactions import ActivityType, Client, Intents, listen
from interactions.api.events import Startup
from utils.extensions_loader import extensions_loader
load_dotenv()
bot = Client(
token=os.getenv("BOT_TOKEN"),
status=interactions.Status.ONLINE,
activity=interactions.Activity(name="with embeds", type=ActivityType.PLAYING),
sync_interactions=True,
intents=Intents.DEFAULT | Intents.MESSAGE_CONTENT,
)
@listen(Startup)
async def on_ready():
print("Sanitizer Bot is Online!")
if __name__ == "__main__":
try:
print("Starting bot and loading exts..")
extensions_names = [
m.name for m in pkgutil.iter_modules(["exts"], prefix="exts.")
]
extensions_loader(extensions_names, bot)
bot.start()
except Exception as e:
print(f"Sanitizer bot could not start.\nError: {e}")
finally:
print("\nSanitizer Bot is Offline")
def get_quick_vids_token() -> str|None:
return os.getenv("QUICKVIDS_TOKEN")