Skip to content

Commit

Permalink
fix: Corrected error with dictionary keys (#41)
Browse files Browse the repository at this point in the history
There was a problem how the help information was displayed in
`wikipedia_command` because an issue with `get_help` and the return
string.
  • Loading branch information
miguelcsx committed Apr 29, 2024
1 parent 0c2e59d commit 3f0c19a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/server/commands/discord_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self):
self.subject_service = SubjectService()

@abstractmethod
def execute(self, *args, **kwargs):
def execute(self):
raise NotImplementedError("Subclasses must implement this method")

@abstractmethod
Expand Down
4 changes: 1 addition & 3 deletions app/server/commands/management_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ def execute(self, entity_type: str, name: str,
def get_help(self):
return {
"brief": "Create a new entity",
"help": "This command allows you to create a new entity. You can use it as follows:\n"
"!create subject <name> <description> - Create a new subject\n"
"!create topic <name> <description> <subject_id> - Create a new topic"
"help": "This command allows you to create a new entity."
}
5 changes: 4 additions & 1 deletion app/server/commands/wikipedia_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ def create_embed(self, title: str, content: str,
return embed

def get_help(self):
return self.parameter_error
return {
"brief": "Access Wikipedia information",
"help": "This command allows you to search or get a summary of a topic from Wikipedia."
}
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dataclasses-json==0.6.4
dill==0.3.8
discord.py==2.3.2
exceptiongroup==1.2.0
flake8==7.0.0
frozenlist==1.4.1
greenlet==3.0.3
idna==3.6
Expand All @@ -36,6 +37,7 @@ pycodestyle==2.11.1
pydantic==2.7.1
pydantic_core==2.18.2
pyflakes==3.2.0
pylint==3.1.0
pytest==8.1.1
python-dotenv==1.0.1
PyYAML==6.0.1
Expand Down

0 comments on commit 3f0c19a

Please sign in to comment.