Total Complexity | 4 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from typing import Optional, NoReturn, Tuple |
||
2 | |||
3 | import dotenv |
||
4 | from discord import Guild, Activity, ActivityType, Intents |
||
5 | from discord.ext import commands |
||
6 | |||
7 | GUILD_ID: int = 888527538710777876 |
||
8 | LOADED_EXTENSIONS: Tuple[str, ...] = ( |
||
9 | 'drinks', 'members', 'utils', 'workers', 'tickets' |
||
10 | ) |
||
11 | |||
12 | |||
13 | class Bot(commands.Bot): |
||
14 | |||
15 | def __init__(self) -> None: |
||
16 | super().__init__(command_prefix='/', intents=Intents.all()) |
||
17 | self.guild: Optional[Guild] = None |
||
18 | |||
19 | self.remove_command('help') |
||
20 | |||
21 | for ext in LOADED_EXTENSIONS: |
||
22 | self.load_extension(f'app.cogs.{ext}') |
||
23 | |||
24 | async def on_ready(self) -> None: |
||
25 | self.guild = self.get_guild(GUILD_ID) |
||
26 | print(self.user, 'is ready') |
||
27 | |||
28 | await self.change_presence( |
||
29 | activity=Activity( |
||
30 | type=ActivityType.watching, |
||
31 | name=f"{self.command_prefix}help" |
||
32 | ) |
||
33 | ) |
||
34 | |||
35 | def run(self) -> NoReturn: |
||
36 | super().run(dotenv.dotenv_values('.env').get('TOKEN')) |
||
37 |