-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbot.py
39 lines (34 loc) · 1.16 KB
/
bot.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
# pylint: disable=missing-module-docstring
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-docstring
# pylint: disable=line-too-long
# pylint: disable=anomalous-backslash-in-string
# pylint: disable=broad-exception-caught
# pylint: disable=import-error
import logging
from interactions import(
Client,
Intents,
listen,
)
import bot_config
logging.basicConfig()
cls_log = logging.getLogger('MyLogger')
cls_log.setLevel(logging.INFO)
client = Client(
intents=Intents.ALL,
token=bot_config.TOKEN,
sync_interactions=True,
asyncio_debug=False,
logger=cls_log,
send_command_tracebacks=False
)
# 👂
@listen()
async def on_startup():
print(f'{client.user} connected to discord')
print('----------------------------------------------------------------------------------------------------------------')
print(f'Bot invite link: https://discord.com/api/oauth2/authorize?client_id={bot_config.CLIENT_ID}&permissions=551903348736&scope=bot')
print('----------------------------------------------------------------------------------------------------------------')
client.load_extensions("commands")
client.start()