Skip to content

Commit

Permalink
Ran Pylint, code fixed, added pylintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
nxrmqlly committed Nov 25, 2023
1 parent cd93f3d commit f8bf34d
Show file tree
Hide file tree
Showing 5 changed files with 428 additions and 21 deletions.
13 changes: 7 additions & 6 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def __init__(self, *args, **kwargs):
intents=discord.Intents.all(),
owner_ids={767115163127906334},
activity=discord.Activity(
type=discord.ActivityType.listening, name="pop music! v0.1.0 /ping"
type=discord.ActivityType.listening,
name="pop music! v0.1.0 /ping",
),
status="idle",
*args,
Expand All @@ -35,10 +36,10 @@ async def setup_hook(self):
"""Set up logger for both logging and console"""
logger = logging.getLogger("discord")
logger.setLevel(logging.DEBUG)
_fmt = "[{levelname}] [{asctime}] {name}: {message}"
_date_fmt = "%d %b %Y %H:%M:%S"
fmt = "[{levelname}] [{asctime}] {name}: {message}"
date_fmt = "%d %b %Y %H:%M:%S"
# Log to file
f_formatter = logging.Formatter(_fmt, _date_fmt, "{")
f_formatter = logging.Formatter(fmt, date_fmt, "{")

file_handler = logging.FileHandler(
"./logs/discord.log", mode="w", encoding="utf-8"
Expand All @@ -47,7 +48,7 @@ async def setup_hook(self):
file_handler.setFormatter(f_formatter)

# Log to console
c_formatter = CustomFormatter(_fmt, _date_fmt, "{")
c_formatter = CustomFormatter(fmt, date_fmt, "{")

console_handler = logging.StreamHandler()
console_handler.setLevel(logging.INFO)
Expand All @@ -63,7 +64,7 @@ async def setup_hook(self):
for ext in EXTENSIONS:
try:
await self.load_extension(ext)
except Exception as exc:
except commands.ExtensionError as exc:
print(colored(f"Failed to load extension {ext}: {exc}", "red"))
else:
loaded_exts.append(ext)
Expand Down
6 changes: 1 addition & 5 deletions exts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
"""(Biolerplate) To Find Extensions In ./exts/**
Attributes:
EXTENSIONS (list): List of extensions present
"""
# pylint: skip-file
from pkgutil import iter_modules

EXTENSIONS = [module.name for module in iter_modules(__path__, f"{__package__}.")]
7 changes: 3 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
Repository:
https://github.com/nxrmqlly/Orbyt
"""

__copyright__ = "Copyright (C) 2023 Ritam Das"
Expand All @@ -35,7 +34,7 @@ async def _run():
"""
Runs the function asynchronously to start the bot.
This function is an async function that starts the Orbyt bot by creating an instance of the Orbyt class and using it as a context manager.
Async function that starts the Bot.
The bot is started by calling the `start` method of the bot instance.
"""
async with Orbyt() as bot:
Expand All @@ -44,7 +43,7 @@ async def _run():

if __name__ == "__main__":
os.system("cls" if os.name == "nt" else "clear")
_title = """
TITLE = """
.oooooo. .o8 .
d8P' `Y8b "888 .o8
888 888 oooo d8b 888oooo. oooo ooo .o888oo By Nxrmqlly
Expand All @@ -57,7 +56,7 @@ async def _run():
"""
print(
colored(
_title,
TITLE,
color="light_magenta",
)
)
Expand Down
Loading

0 comments on commit f8bf34d

Please sign in to comment.