1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-02 16:43:12 +00:00

style(neofetch.py, cog_loader.py, avatar.py, tldr.py): correct comment block formatting for consistency

refactor(neofetch.py): modify line separator for better visual appeal
This commit is contained in:
kzndotsh 2024-07-15 10:46:57 +00:00
parent 9dde15a4ce
commit 679de67165
4 changed files with 22 additions and 22 deletions

View file

@ -60,7 +60,7 @@ class Neofetch(commands.Cog):
memusage = psutil.virtual_memory().percent
lines = f"""{yellow}tux{reset}@{yellow}{interaction.guild.name.lower().replace(" ", "")}{reset}
------------------
-----------------
Tux Stats{reset}
{red}OS{reset}: Tux Alpha
{yellow}Kernel{reset}: 6.9
@ -68,7 +68,7 @@ class Neofetch(commands.Cog):
{cyan}CPU{reset}: {cpuusage}%
{blue}Memory{reset}: {memusage}%
{pink}Ping{reset}: {round(self.bot.latency * 1000)}ms
------------------
-----------------
Server Stats{reset}
{red}Name{reset}: {interaction.guild.name}
{yellow}Owner{reset}: {interaction.guild.owner}
@ -76,7 +76,7 @@ class Neofetch(commands.Cog):
{cyan}Roles{reset}: {len(interaction.guild.roles)}
{blue}Channels{reset}: {len(interaction.guild.channels)}
{pink}Emojis + Stickers{reset}: {len(interaction.guild.emojis) + len(interaction.guild.stickers)}
------------------
-----------------
"""
fetch = (

View file

@ -19,12 +19,12 @@ class CogLoader(commands.Cog):
Checks if the specified file is a cog.
Parameters
-----------
----------
filepath : Path
The path to the file to check.
Returns
--------
-------
bool
True if the file is a cog, False otherwise.
"""
@ -43,12 +43,12 @@ class CogLoader(commands.Cog):
Recursively loads eligible cogs from the specified directory.
Parameters
-----------
----------
path : Path
The path to the directory containing cogs.
Returns
--------
-------
None
Raises
@ -87,12 +87,12 @@ class CogLoader(commands.Cog):
Loads cogs from the specified folder.
Parameters
-----------
----------
folder_name : str
The name of the folder containing the cogs.
Returns
--------
-------
None
"""

View file

@ -23,7 +23,7 @@ class Avatar(commands.Cog):
Get the global/server avatar for a member.
Parameters
-----------
----------
interaction : discord.Interaction
The discord interaction object.
member : discord.Member
@ -47,7 +47,7 @@ class Avatar(commands.Cog):
Get the global/server avatar for a member.
Parameters
-----------
----------
ctx : commands.Context[commands.Bot]
The context in which the command is being invoked.
member : discord.Member
@ -106,12 +106,12 @@ class Avatar(commands.Cog):
Create a discord file from an avatar url.
Parameters
-----------
----------
url : str
The url of the avatar.
Returns
--------
-------
discord.File
The discord file.
"""

View file

@ -21,14 +21,14 @@ class Tldr(commands.Cog):
Provide autocomplete suggestions for TLDR commands based on user query.
Parameters
-----------
----------
interaction : discord.Interaction
The interaction object where autocomplete happens.
query : str
Partial input from the user used to filter suggestions.
Returns
--------
-------
List[app_commands.Choice[str]]
A list of up to 25 command names as autocomplete choices.
"""
@ -51,7 +51,7 @@ class Tldr(commands.Cog):
Show a TLDR page for a CLI command
Parameters
-----------
----------
interaction : discord.Interaction
The discord interaction object.
command : str
@ -81,7 +81,7 @@ class Tldr(commands.Cog):
Show a TLDR page for a CLI command
Parameters
-----------
----------
ctx : commands.Context[commands.Bot]
The context object for the command.
command : str
@ -105,12 +105,12 @@ class Tldr(commands.Cog):
Retrieves the TLDR page for a given command.
Parameters
-----------
----------
command : str
The command to lookup.
Returns
--------
-------
str
The content of the TLDR page or an error message.
"""
@ -125,7 +125,7 @@ class Tldr(commands.Cog):
Fetches a list of available TLDR pages.
Returns
--------
-------
list[str]
List of available commands in the TLDR pages.
"""
@ -137,14 +137,14 @@ class Tldr(commands.Cog):
Helper method to run subprocesses for CLI interactions.
Parameters
-----------
----------
command_list : list[str]
List containing the command and its arguments.
default_response : str
The default response if subprocess does not output anything.
Returns
--------
-------
str
The stdout from the subprocess as a string, or an error message.