Skip to content
Merged
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
15 changes: 7 additions & 8 deletions techsupport_bot/commands/htd.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""
Convert a value or evalute a mathematical expression to decimal, hex, binary, and ascii encoding

Convert a value or evaluate a mathematical expression to decimal, hex, binary, and ascii encoding
"""

import discord
Expand All @@ -24,7 +23,7 @@ class Htd(cogs.BaseCog):

def split_nicely(self, str_to_split: str) -> list:
"""Takes an input string of an equation, and
returns a list with numbers and operators in seperate parts
returns a list with numbers and operators in separate parts

Args:
str_to_split (str): The equation to parse
Expand Down Expand Up @@ -65,7 +64,7 @@ def convert_value_to_integer(self, val: str) -> int:
val (str): The given value to convert

Returns:
int: The value represeted as an integer
int: The value represented as an integer
"""

if val.replace("-", "").startswith("0x"):
Expand Down Expand Up @@ -125,11 +124,11 @@ def perform_op_on_list(self, equation_list: list) -> int:
brief="Convert values to different bases",
description=(
"Takes a value and returns the value in different bases and"
" encodings (bianary, hex, base 10, and ascii)"
" encodings (binary, hex, base 10, and ascii)"
),
usage=(
"`htd [value]`\nAccepts numbers in the following formats:\n0x"
" (hex)\n0b (binary) \nNo prefix (assumed ascii)"
"`[value]`\nAccepts numbers in the following formats:\n0x"
" (hex)\n0b (binary) \nNo prefix (assumed decimal)"
),
)
async def htd(self, ctx, *, val_to_convert):
Expand All @@ -143,7 +142,7 @@ async def htd(self, ctx, *, val_to_convert):

def clean_input(self, input: str) -> str:
"""A method to clean up input to be better processed by later functions
This replaces "#" with "0x" to recoginzed "#" as hex
This replaces "#" with "0x" to recognized "#" as hex
It also removes quotes and spaces

Args:
Expand Down