Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/help command #30

Merged
merged 9 commits into from
Oct 25, 2023
Merged

Feat/help command #30

merged 9 commits into from
Oct 25, 2023

Conversation

J3y0
Copy link
Contributor

@J3y0 J3y0 commented Jul 31, 2023

This PR solves #15 issue.

Problem was the bot didn't have the guild intent which is necessary for the help command (didn't find it on the internet so I did find it by trying repeatedly with different intents...).

This PR brings:

  • A refactor of craft_intent function where intents accorded to the bot are clearly stated (it was impossible for me to understand what intents were linked to the value passed in argument to the Intent() constructor.
  • A custom HelpCommand which implements the class HelpCommand of the discord library. It is very simple for now and has to be considered as a base for future and more complex implementation.
  • As the HelpCommand implementation is directly given to the Bot() constructor, the help command was not in the COG and couldn't be subject to logging with the before_invoke decorator. This is why, I added logging into the on_command event. Then, logging is automatically done when a command is triggered

Copy link
Contributor

@ctmbl ctmbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems great! Just a few question but you did a great job actually!!

Thanks for rewriting the craft_intents fucntion it was a mess ahah
and the commands desc looks great too!

src/bot/custom_help_command.py Show resolved Hide resolved
src/bot/root_pythia_bot.py Show resolved Hide resolved
src/bot/root_pythia_cogs.py Show resolved Hide resolved
@J3y0
Copy link
Contributor Author

J3y0 commented Aug 12, 2023

Thanks for your review ! Feel free to ask some features you would like to see in the custom help command ! I add the strict minimum right now !

@J3y0
Copy link
Contributor Author

J3y0 commented Sep 4, 2023

I couldn't get a perfect pylint as it misses the fact I am implementing correctly the methods of the HelpCommand class. I looked at the source code to be sure.

This is why, I tried to look at a similar issue and it turns out there is an issue on the arguments-differ feature of pylint.

Copy link
Contributor

@ctmbl ctmbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a long time ago so I may have missed some caveats but seems ready to me!

src/bot/root_pythia_bot.py Show resolved Hide resolved
src/bot/root_pythia_cogs.py Show resolved Hide resolved
@ctmbl
Copy link
Contributor

ctmbl commented Sep 19, 2023

@J3y0

I couldn't get a perfect pylint as it misses the fact I am implementing correctly the methods of the HelpCommand class. I looked at the source code to be sure.

Problem is that you won't be able to merge the PR if pylint doesn't pass...
I try to avoid doing this but you can disable this pylint feature (globally in the pylintrc or locally in the source code) if you need 😕

This is why, I tried to look at a similar issue and it turns out there is an pylint-dev/pylint#1553 on the arguments-differ feature of pylint.

hmm the issue is closed don't know if it should be solved or not to be honest

@ctmbl
Copy link
Contributor

ctmbl commented Oct 15, 2023

once @J3y0 will have resolved/answered the last thread we'll be able to merge this!

@ctmbl ctmbl assigned ctmbl and J3y0 Oct 18, 2023
@ctmbl ctmbl added the enhancement New feature or request label Oct 18, 2023
@ctmbl ctmbl linked an issue Oct 18, 2023 that may be closed by this pull request
@ctmbl ctmbl merged commit 2d17a67 into iScsc:main Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Root-pythia bot misses a help command
3 participants