GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

axiol.bot.Bot.run()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
"""Axiol Bot Core."""
2
3
import os
4
import dotenv
5
6
from discord.ext import commands
7
from classes.logger import log
0 ignored issues
show
introduced by
Unable to import 'classes.logger'
Loading history...
8
9
TOKEN_KEY: str = 'TOKEN'
10
11
12
class Bot(commands.Bot):
13
    """Axiol custom bot class."""
14
15
    def __init__(self) -> None:
16
        log.inform("Initializing bot...")
17
18
        super(Bot, self).__init__(command_prefix=',')
19
        self.remove_command('help')
20
21
    def run(self) -> None:
0 ignored issues
show
Bug introduced by
Parameters differ from overridden 'run' method
Loading history...
22
        log.inform("Starting bot...")
23
24
        super(Bot, self).run(
25
            os.environ.get(TOKEN_KEY)
26
            or dotenv.dotenv_values('.env').get(TOKEN_KEY)
27
        )
28
29
    async def on_connect(self) -> None:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
30
        log.success(f"Logging in as {self.user}.")
31
32
    async def on_ready(self) -> None:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
33
        log.info(f"{self.user} is ready for use.")
34