-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
47 lines (33 loc) · 1.06 KB
/
main.py
File metadata and controls
47 lines (33 loc) · 1.06 KB
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
43
44
45
46
47
from os import path
from glob import glob
from interactions import listen, Client, Intents, MISSING, events
from interactions.ext import prefixed_commands
from core.settings import config
from dotenv import load_dotenv
from os import getenv
from core.logging import bot_logger
load_dotenv()
TOKEN = getenv("TOKEN")
client = Client(
auto_defer=True,
debug_scope=config.get_setting("guild_id", MISSING),
delete_unused_application_cmds=True,
send_command_tracebacks=False,
intents=Intents.ALL,
token=TOKEN,
logger=bot_logger,
send_not_ready_messages=True,
show_ratelimit_tracebacks=True,
)
prefixed_commands.setup(client, default_prefix="=")
@listen()
async def on_ready(event: events.Ready):
bot_logger.info(f"Logged in as {client.user}")
ext_filenames = glob(path.join("interaction", "**", "*.py"), recursive=True)
EXTENSIONS = [
path.splitext(filename)[0].replace(path.sep, ".") for filename in ext_filenames
]
for extension in EXTENSIONS:
client.load_extension(extension)
if __name__ == "__main__":
client.start()