Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
ignore = DCO010, DCO023, E203, E501, E712, F401, F403, F821, W503
ignore = DCO010, DCO023, DOC602, DOC603, E203, E501, E712, F401, F403, F821, W503
style = google
skip-checking-short-docstrings = False
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typing_extensions = "==4.8.0"
pip = "==24.1.2"
pipenv = "==2024.0.1"
pydantic = "==2.8.2"
pydoclint = "==0.4.1"
pydoclint = "==0.5.6"
pylint = "==3.2.6"
pynacl = "==1.5.0"
pytest = "==8.3.1"
Expand Down
14 changes: 7 additions & 7 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion techsupport_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TechSupportBot(commands.Bot):
allowed_mentions (discord.AllowedMentions): What the bot is, or is not,
allowed to mention

Attrs:
Attributes:
CONFIG_PATH (str): The hard coded path to the yaml config file
EXTENSIONS_DIR_NAME (str): The hardcoded folder for commands
EXTENSIONS_DIR (str): The list of all files in the EXTENSIONS_DIR_NAME folder
Expand Down
14 changes: 7 additions & 7 deletions techsupport_bot/botlogging/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ class LogLevel(Enum):
"""This is a way to map log levels to strings, and have the easy ability
to dynamically add or remove log levels

Attrs:
Attributes:
DEBUG (str): Representation of debug
INFO (str): Representation of info
WARNING (str): Representation of warning
ERROR (str): Representation of error
"""

DEBUG = "debug"
INFO = "info"
WARNING = "warning"
ERROR = "error"
DEBUG: str = "debug"
INFO: str = "info"
WARNING: str = "warning"
ERROR: str = "error"


@dataclass
class LogContext:
"""A very simple class to store a few contextual items about the log
This is used to determine if some guild settings means the log shouldn't be logged

Attrs:
Attributes:
guild (discord.Guild | None): The guild the log occured with. Optional
channel (discord.abc.Messageble | None): The channel, DM, thread,
channel (discord.abc.Messageable | None): The channel, DM, thread,
or other messagable the log occured in
"""

Expand Down
30 changes: 15 additions & 15 deletions techsupport_bot/botlogging/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class LogEmbed(discord.Embed):
Args:
message (str): The message to log. Will become the description of an embed

Attrs:
Attributes:
title (str): The title of the embed
color (discord.Color): The color of the embed
"""

title = None
color = None
title: str = None
color: discord.Color = None

def __init__(self: Self, message: str) -> None:
super().__init__(
Expand Down Expand Up @@ -49,46 +49,46 @@ def modify_embed(self: Self, embed: discord.Embed) -> discord.Embed:
class InfoEmbed(LogEmbed):
"""Embed for info level log events.

Attrs:
Attributes:
title (str): The title of the embed
color (discord.Color): The color of the embed
"""

title = "info"
color = discord.Color.green()
title: str = "info"
color: discord.Color = discord.Color.green()


class DebugEmbed(LogEmbed):
"""Embed for debug level log events.

Attrs:
Attributes:
title (str): The title of the embed
color (discord.Color): The color of the embed
"""

title = "debug"
color = discord.Color.dark_green()
title: str = "debug"
color: discord.Color = discord.Color.dark_green()


class WarningEmbed(LogEmbed):
"""Embed for warning level log events.

Attrs:
Attributes:
title (str): The title of the embed
color (discord.Color): The color of the embed
"""

title = "warning"
color = discord.Color.gold()
title: str = "warning"
color: discord.Color = discord.Color.gold()


class ErrorEmbed(LogEmbed):
"""Embed for error level log events.

Attrs:
Attributes:
title (str): The title of the embed
color (discord.Color): The color of the embed
"""

title = "error"
color = discord.Color.red()
title: str = "error"
color: discord.Color = discord.Color.red()
1 change: 1 addition & 0 deletions techsupport_bot/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
from .linter import *
from .listen import *
from .mock import *
from .relay import *
from .roll import *
from .wyr import *
10 changes: 5 additions & 5 deletions techsupport_bot/commands/animal.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ async def setup(bot: bot.TechSupportBot) -> None:
class Animals(cogs.BaseCog):
"""The class for the animals commands

Attrs:
Attributes:
CAT_API_URL (str): The URL for the cat API
DOG_API_URL (str): The URL for the dog API
FOX_API_URL (str): The URL for the fox API
FROG_API_URL (str): The URL for the frog API
"""

CAT_API_URL = "https://api.thecatapi.com/v1/images/search?limit=1&api_key={}"
DOG_API_URL = "https://dog.ceo/api/breeds/image/random"
FOX_API_URL = "https://randomfox.ca/floof/"
FROG_API_URL = "https://frogs.media/api/random"
CAT_API_URL: str = "https://api.thecatapi.com/v1/images/search?limit=1&api_key={}"
DOG_API_URL: str = "https://dog.ceo/api/breeds/image/random"
FOX_API_URL: str = "https://randomfox.ca/floof/"
FROG_API_URL: str = "https://frogs.media/api/random"

@auxiliary.with_typing
@commands.command(name="cat", brief="Gets a cat", description="Gets a cat")
Expand Down
14 changes: 7 additions & 7 deletions techsupport_bot/commands/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ class ApplicationStatus(Enum):
"""Static string mapping of all status
This is so the database can always be consistent

Attrs:
Attributes:
PENDING (str): The string representation for pending
APPROVED (str): The string representation for approved
DENIED (str): The string representation for denied
REJECTED (str): The string representation for rejected
"""

PENDING = "pending"
APPROVED = "approved"
DENIED = "denied"
REJECTED = "rejected"
PENDING: str = "pending"
APPROVED: str = "approved"
DENIED: str = "denied"
REJECTED: str = "rejected"


async def setup(bot: bot.TechSupportBot) -> None:
Expand Down Expand Up @@ -198,11 +198,11 @@ async def wait(self: Self, config: munch.Munch, guild: discord.Guild) -> None:
class ApplicationManager(cogs.LoopCog):
"""This cog is responsible for the majority of functions in the application system

Attrs:
Attributes:
application_group (app_commands.Group): The group for the /application commands
"""

application_group = app_commands.Group(
application_group: app_commands.Group = app_commands.Group(
name="application", description="...", extras={"module": "application"}
)

Expand Down
4 changes: 2 additions & 2 deletions techsupport_bot/commands/burn.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ async def setup(bot: bot.TechSupportBot) -> None:
class Burn(cogs.BaseCog):
"""Class for Burn command on the discord bot.

Attrs:
Attributes:
PHRASES (list[str]): The list of phrases to pick from
"""

PHRASES = [
PHRASES: list[str] = [
"Sick BURN!",
"Someone is going to need ointment for that BURN!",
"Fire! Call 911! Someone just got BURNED!",
Expand Down
6 changes: 3 additions & 3 deletions techsupport_bot/commands/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ async def setup(bot: bot.TechSupportBot) -> None:
class ChatGPT(cogs.BaseCog):
"""Main extension class

Attrs:
Attributes:
API_URL (str): The URL for the openai API
SYSTEM_PROMPT (dict[str, str]): The default starting prompt for chatGPT
"""

API_URL = "https://api.openai.com/v1/chat/completions"
API_URL: str = "https://api.openai.com/v1/chat/completions"

async def preconfig(self: Self) -> None:
"""Sets up the dict"""
Expand All @@ -62,7 +62,7 @@ async def preconfig(self: Self) -> None:
max_age_seconds=3600,
)

SYSTEM_PROMPT = [
SYSTEM_PROMPT: dict[str, str] = [
{
"role": "system",
"content": (
Expand Down
6 changes: 3 additions & 3 deletions techsupport_bot/commands/conch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ async def setup(bot: bot.TechSupportBot) -> None:
class MagicConch(cogs.BaseCog):
"""Class to create the conch command for discord bot.

Attrs:
Attributes:
RESPONSES (list[str]): The list of random responses for the 8 ball
PIC_URL (str): The direct URL for the picture to put in embeds

"""

RESPONSES = [
RESPONSES: list[str] = [
"As I see it, yes.",
"Ask again later.",
"Better not tell you now.",
Expand All @@ -57,7 +57,7 @@ class MagicConch(cogs.BaseCog):
"Yes - definitely.",
"You may rely on it.",
]
PIC_URL = "https://i.imgur.com/vdvGrsR.png"
PIC_URL: str = "https://i.imgur.com/vdvGrsR.png"

def format_question(self: Self, question: str) -> str:
"""This formats a question properly. It will crop it if needed, and add a "?" to the end
Expand Down
16 changes: 10 additions & 6 deletions techsupport_bot/commands/duck.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,26 @@ async def setup(bot: bot.TechSupportBot) -> None:
class DuckHunt(cogs.LoopCog):
"""Class for the actual duck commands

Attrs:
Attributes:
DUCK_PIC_URL (str): The picture for the duck
BEFRIEND_URL (str): The picture for the befriend target
KILL_URL (str): The picture for the kill target
ON_START (bool): ???
CHANNELS_KEY (str): The config item for the channels that the duck hunt should run
"""

DUCK_PIC_URL = "https://cdn.icon-icons.com/icons2/1446/PNG/512/22276duck_98782.png"
BEFRIEND_URL = (
DUCK_PIC_URL: str = (
"https://cdn.icon-icons.com/icons2/1446/PNG/512/22276duck_98782.png"
)
BEFRIEND_URL: str = (
"https://cdn.icon-icons.com/icons2/603/PNG/512/"
+ "heart_love_valentines_relationship_dating_date_icon-icons.com_55985.png"
)
KILL_URL = "https://cdn.icon-icons.com/icons2/1919/PNG/512/huntingtarget_122049.png"
ON_START = False
CHANNELS_KEY = "hunt_channels"
KILL_URL: str = (
"https://cdn.icon-icons.com/icons2/1919/PNG/512/huntingtarget_122049.png"
)
ON_START: bool = False
CHANNELS_KEY: str = "hunt_channels"

async def loop_preconfig(self: Self) -> None:
"""Preconfig for cooldowns"""
Expand Down
4 changes: 2 additions & 2 deletions techsupport_bot/commands/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ async def setup(bot: bot.TechSupportBot) -> None:
class Emojis(cogs.BaseCog):
"""Class for all the emoji commands

Attrs:
Attributes:
KEY_MAP (dict[str,str]): Some manual mappings from character to emoji
"""

KEY_MAP = {"?": "question", "!": "exclamation"}
KEY_MAP: dict[str, str] = {"?": "question", "!": "exclamation"}

@classmethod
def emoji_from_char(cls: Self, char: str) -> str:
Expand Down
4 changes: 2 additions & 2 deletions techsupport_bot/commands/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class ExtensionControl(cogs.BaseCog):
"""
The class that holds the extension commands

Attrs:
Attributes:
extension_app_command_group (app_commands.Group): The group for the /extension commands
"""

extension_app_command_group = app_commands.Group(
extension_app_command_group: app_commands.Group = app_commands.Group(
name="extension", description="...", extras={"module": "extension"}
)

Expand Down
Loading