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

Help Embed added #182

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

SnowyJaguar1034
Copy link

I added an embedded help command to the KoalaBot.py file. I added it here (for now) because I am still working on making it a paginator. I ran into an issue when installing DiscordUtils from https://pypi.org/project/DiscordUtils/ as my machine failed to install PyNacl several times which delayed the process of importing the pagination. Once it did manage to install PyNacl it started having issues installing DiscordUtils so this is an ongoing troubleshooting process.

As I am stuck for a while with the pagination I started working on an Info.py cog which will be its own pr.

I added an embedded help command to the KoalaBot.py file. I added it here (for now) because I am still working on making it a paginator. I ran into an issue when installing DiscordUtils from https://pypi.org/project/DiscordUtils/ as my machine failed to install PyNacl several times which delayed the process of importing the pagination. 

As I was stuck fo a while with the pagination I started working on an Info.py cog which will be its own pr.
Just removed some comments I had added to help me work through the process of troubleshooting my pip setup
I added an embedded help command to the KoalaBot.py file. I added it here (for now) because I am still working on making it a paginator. I ran into an issue when installing DiscordUtils from https://pypi.org/project/DiscordUtils/ as my machine failed to install PyNacl several times which delayed the process of importing the pagination. 

As I was stuck fo a while with the pagination I started working on an Info.py cog which will be its own pr.
I added an embedded help command to the KoalaBot.py file. I added it here (for now) because I am still working on making it a paginator. I ran into an issue when installing DiscordUtils from https://pypi.org/project/DiscordUtils/ as my machine failed to install PyNacl several times which delayed the process of importing the pagination. 

As I was stuck fo a while with the pagination I started working on an Info.py cog which will be its own pr.
This cog currently retrieves User Information, server Information, and User permissions (both server-wide and for specific channels). I am also going to be adding in role information and channel information. I might also throw in a stats command altho I'm unsure on that one.
@JayDwee
Copy link
Member

JayDwee commented May 23, 2021

Take a look at https://github.com/Rapptz/discord.py for PyNaCl instructions. Make sure that if you need to install any new packages you show it in readme.md, and if you change or import any new pip libs, update requirements.txt and production-requirements.txt.

@JayDwee
Copy link
Member

JayDwee commented May 23, 2021

Also please set the PR as a draft for now, once you believe you are done you can then set it to be open and we can start reviewing and so on (did for you)

@JayDwee JayDwee marked this pull request as draft May 23, 2021 12:51
@SnowyJaguar1034
Copy link
Author

Also please set the PR as a draft for now, once you believe you are done you can then set it to be open and we can start reviewing and so on (did for you)

Hi thanks for doing that for me. I was a bit busy the past few days and I wasn't 100% sure how to do it bc I'm not very familiar with github.

@JayDwee JayDwee linked an issue May 25, 2021 that may be closed by this pull request
@JayDwee
Copy link
Member

JayDwee commented May 25, 2021

No worries, If there are any questions about the design of a feature, discussions/questions need to be in the issue (#153). If the question/discussion is about the implementation, they can be asked in this pull request.

Thank you for your development, in the next couple weeks I'll make a more useful CONTRIBUTING.md to help with all this for the future.

@JayDwee
Copy link
Member

JayDwee commented May 26, 2021

I ran into an issue when installing DiscordUtils from https://pypi.org/project/DiscordUtils/ as my machine failed to install PyNacl several times which delayed the process of importing the pagination. Once it did manage to install PyNacl it started having issues installing DiscordUtils so this is an ongoing troubleshooting process.

If you add git+https://github.com/KoalaBotUK/DiscordUtils to requirements.txt and production-requirements.txt and then do

$ pip3 install -r requirements.txt

DiscordUtils should be installed without voice requirements or support (which should be ok)

I've put in a PR with DiscordUtils so hopefully that can be sorted and then added after which we will change back to using their branch, but in the mean time this should allow you to continue development

I noticed you also had discord-ext-menus being used. Due to this not having a PyPi package, and being made for internal testing I'd advise against using it as it is essentially unsupported so alternate ways of doing the same stuff should be used instead.

@SnowyJaguar1034
Copy link
Author

It might take me a while to get this working as my system doesn't seem to be installing pip packages correctly. I had a few versions of python installed and was working using Python 3.9 but all my packages were installing to Python 3.8 and it wasn't letting me install them elsewhere and using python 3.8 broke all of the code so 🤷 I need to do a clean install anyway soon so I'm thinking of doing that in the next week or so and am hoping that will fix my issues.

I uninstalled my other python versions and kept only 3.9 but that claimed it didn't have pip so I reinstalled that as well as it still claimed it didn't have pip. I also still seem to have 3.8 installed despite it not showing in my installed programs

@JayDwee
Copy link
Member

JayDwee commented May 29, 2021

It might take me a while to get this working as my system doesn't seem to be installing pip packages correctly. I had a few versions of python installed and was working using Python 3.9 but all my packages were installing to Python 3.8 and it wasn't letting me install them elsewhere and using python 3.8 broke all of the code so 🤷 I need to do a clean install anyway soon so I'm thinking of doing that in the next week or so and am hoping that will fix my issues.

I uninstalled my other python versions and kept only 3.9 but that claimed it didn't have pip so I reinstalled that as well as it still claimed it didn't have pip. I also still seem to have 3.8 installed despite it not showing in my installed programs

Hmm that's strange, sorry to hear that, once you get pip working you may want to look into virtual environments (venv) for further development so this issue doesn't happen again.

@SnowyJaguar1034
Copy link
Author

Finally got my windows instill all fixed so i can get back to coding this cog

@SnowyJaguar1034
Copy link
Author

So Koalabots self-hosting guide says it needs Python 3.8? Is that any version of 3.8 including 3.8.10? Just want to make sure I am instaling a compatble version

@SnowyJaguar1034
Copy link
Author

SnowyJaguar1034 commented Jun 13, 2021

Hi, I'm re-installing my coding environment after a code conflict. I am setting it up as a virtual environment for each bot, The code for the first bot I am doing is contained within C:\Users\Teaga\Documents\Discord-Bot\KoalaBot-master. Is this the correct way to create the virtual environment virtualenv C:\Users\Teaga\Documents\Discord-Bot\KoalaBot-master? I asked in the discord.py server but didn't get a response, which is typical in my experience

@JayDwee
Copy link
Member

JayDwee commented Jun 13, 2021

Try the following:

$ cd C:\Users\Teaga\Documents\Discord-Bot\KoalaBot-master
$ virtualenv venv
$ . C:\Users\Teaga\Documents\Discord-Bot\KoalaBot-master\venv\Scripts\activate

@SnowyJaguar1034
Copy link
Author

SnowyJaguar1034 commented Jun 13, 2021

Little Update

  • I got my machine all setup for coding again. Yay!
  • I have a working custom help command showing all of the commands (ColourRole, TextFilter and TwitchAlert are disabled in this screenshot to make it fit on the screen)
  • I have a working pagination command courtesy of DiscordUtils. Now I just need to get the help command to send to the paginator.
  • working roleinfo command
  • Working permissions command
  • Working serverinfo command
  • Working stats command
  • Slightly broken whois command
  • Broken channelinfo command
  • I will be making the info commands a separate pr, when I have help command finished, unless your happy with it now?
  • I'm not sure why enableExt and disableExt don't show in the bot created help, it is very odd considering the commands work and the subcommands also work. The bit they show up in is a bit I added.

Help Command
Paginate 1
Paginate 2
Paginate 3
roleinfo
serverinfo
stats
permsissions

@SnowyJaguar1034
Copy link
Author

SnowyJaguar1034 commented Jun 15, 2021

Little Update

  • I got my machine all setup for coding again. Yay!
  • I have a working custom help command showing all of the commands (ColourRole, TextFilter and TwitchAlert are disabled in this screenshot to make it fit on the screen)
  • I have a working pagination command courtesy of DiscordUtils. Now I just need to get the help command to send to the paginator.
  • working roleinfo command
  • Working permissions command
  • Working serverinfo command
  • Working stats command
  • Slightly broken whois command
  • Broken channelinfo command
  • I will be making the info commands a separate pr, when I have help command finished, unless your happy with it now?
  • I'm not sure why enableExt and disableExt don't show in the bot-created help, it is very odd considering the commands work and the subcommands also work. The bit they show up in is a bit I added.

Update to this:

I got the paginated help command working. It's not 100% finished bc I am trying to add a greeting msg to the front of the pagination list but it's not working very well. But the help command list itself works

Edit:

the bot throw a UNIQUE constraint failed: GuildExtensions.extension_id, GuildExtensions.guild_id error in the terminal twice during testing however I was unable to replicate this when testing the suspected cause of unloading/loading/reloading of the help cog.

Edit of the edit:

I think I identified the cause of the error, the disabled extensions. I think the bot is trying to pull info from those extensions and can't, leading to the error. This error however does not stop the help command from working. It could be fixed by getting the help command to only pull into from the enabled extensions but I'm not sure how to do that and do I'll leave it for now as the terminal error doesn't affect the bots responsiveness, at least not yet anyway.

edit of the edit of the edit:

Tested disabling TwitchAlert, TextFilter and Announce. None of them gave an error when the help command was used when the extensions were disabled👍. TwitchAlert and TextFilter didn't show up in the help menu but announce did but then I realised I'm running the version without the ability to disable announce 🤦. All in all, apart from the main page of the help menu which gives ppl some info about Koala and it's extensions, the whole thing works and I should be ready to upload it soon.

edit of the edit of the edit of the edit:

I have the help command home page all set up, What are your thoughts?
image
I was going to put Extensions, enableExt <extension|all> and disableExt <extension|all> all on their own fields but due to the way the paginator works I had to new line them instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Help Command
2 participants