-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
47 lines (32 loc) · 1018 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
43
44
45
46
47
import discord
from discord.ext import commands
from src.boot import ENV
INTENTS = discord.Intents.all()
COGS = [
'src.cogs.link',
'src.cogs.role',
]
class Bot(commands.Bot):
def __init__(self):
super().__init__(
command_prefix='!',
intents=INTENTS,
)
async def setup_hook(self) -> None:
# await db.init()
for cog in COGS:
await self.load_extension(cog)
self.tree.copy_global_to(guild=discord.Object(id='530299114387406860'))
await self.tree.sync(guild=discord.Object(id='530299114387406860'))
return await super().setup_hook()
async def on_ready(self):
print('Bot is ready')
async def on_message(self, message):
print('Message received:', message.content)
await self.process_commands(message)
# TOKEN = os.getenv('TOKEN')
# if TOKEN is None:
# raise ValueError('Token is not set')
if __name__ == '__main__':
bot = Bot()
bot.run(ENV.get('BOT_TOKEN'))