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

Load/Unload Cogs #15

Open
uncomfyhalomacro opened this issue Dec 20, 2020 · 22 comments · May be fixed by #157
Open

Load/Unload Cogs #15

uncomfyhalomacro opened this issue Dec 20, 2020 · 22 comments · May be fixed by #157
Assignees
Labels
area: commands Commands, cogs and extensions area: utilities priority: high High priority status: WIP This is being worked on type: feature A request for or implementation of a new feature

Comments

@uncomfyhalomacro
Copy link
Contributor

Once we are done with the core, I would like us to have this feature. We will need to have a feature where we can load and unload specific commands. This way, we have more control of the bot (specifically the Supreme Gurkan and his trusted cucumbers). The command will look like .ext load <command/Cog> or .ext unload <command/Cog>. I think @Xithrius have made this kind of feature. However, I do not want him to take responsibility for this feature, I want others to take part and use this chance to learn new things. If you have any suggestions, proposals, rebuttals, and comments, feel free to do it here.

@RandomDev26
Copy link
Contributor

I think this is a great idea, and will most likely prove to be useful.

@Xithrius
Copy link
Contributor

Xithrius commented Dec 20, 2020

.ext load <command/Cog> or .ext unload <command/Cog>

@ReneganRonin I'm not sure what you mean by changing the load status of a command, but I can for sure unload/load/reload a cog or extension.

@gustavwilliam
Copy link
Member

Maybe we could implement something to activate or deactivate individual commands later on, but for now the cogs will do. That's the most important part.

@Xithrius
Copy link
Contributor

Xithrius commented Dec 20, 2020

I'm not sure if enabling/disabling a command on the fly is actually possible without hardcoding it.

Edit: Nevermind, I think it is possible with this update method of command objects.

Edit 2: Yes, it is possible with that feature. You need a object of command type, and then you can use the .update method. To enable/disable the command the method can be called by command_to_change.update(enabled=False)

@gustavwilliam
Copy link
Member

Maybe we could add some dark magic in the command processing that checks if some "is_active" item is true in a dict. That's the only way I can think of really.

@Shivansh-007
Copy link
Contributor

Maybe we could add some dark magic in the command processing that checks if some "is_active" item is true in a dict. That's the only way I can think of really.

Hmmm, yeah! we could put that case, like if it is not active, we could display some message and if it active it would run normally

@gustavwilliam
Copy link
Member

That would be quite simple to manage in the error handler. Also, @Xithrius has managed to figure out how a disable command could work. It would be possible.

@Xithrius
Copy link
Contributor

Edit 2: Yes, it is possible with that feature. You need a object of command type, and then you can use the .update method. To enable/disable the command the method can be called by command_to_change.update(enabled=False)

@Shivansh-007 here's what I figured out.

@Shivansh-007
Copy link
Contributor

Edit 2: Yes, it is possible with that feature. You need a object of command type, and then you can use the .update method. To enable/disable the command the method can be called by command_to_change.update(enabled=False)

@Shivansh-007 here's what I figured out.

Ah ok, didn't see that 😅

@gustavwilliam
Copy link
Member

It's anyone interested in giving this a shot? It's very convenient — especially during development.

@Xithrius
Copy link
Contributor

If no one takes it, I will.

@uncomfyhalomacro
Copy link
Contributor Author

@Xithrius alright. dunno why no one wants to take it. i am mostly busy so i cant do that as well

@gustavwilliam
Copy link
Member

Hey @Xithrius, do we have any progress on this?

If you want something to base this on, the PyDis ext commands are pretty good. I personally migrated it from Python to
Sir Lancelot (SeasonalBot) a while back, and it shouldn't be a nightmare to migrate to this bot, if you want to use it as a base.

@gustavwilliam gustavwilliam added area: commands Commands, cogs and extensions area: utilities priority: high High priority status: WIP This is being worked on type: feature A request for or implementation of a new feature labels Jan 2, 2021
@Xithrius
Copy link
Contributor

Xithrius commented Jan 3, 2021

@gustavwilliam I'll probably use a variant of the one that I have in my own bot. The command can be seen here.

Will most likely change it once error logging and any other PRs are merged.

@gustavwilliam
Copy link
Member

Ah, perfect. For the record, I've put this as a high priority issue, since it's really important during development of basically all features.

@Inheritanc-e
Copy link

umm do u mean commands or cog?

@Shivansh-007
Copy link
Contributor

Cogs

@Xithrius Xithrius changed the title Load/Unload Commands Load/Unload Cogs Jan 3, 2021
@gustavwilliam
Copy link
Member

Is anyone interested in working on this issue? Xithrius doesn’t have time for it at the time being.

@uncomfyhalomacro
Copy link
Contributor Author

i guess i will start working on this over the weekend. i will review the docs.

@Arnav-2004
Copy link
Contributor

Assign this to me please

@onerandomusername
Copy link
Contributor

I don't think anyone is ever going to implement this.

@onerandomusername onerandomusername linked a pull request Dec 15, 2021 that will close this issue
@onerandomusername
Copy link
Contributor

I was a bit bored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: commands Commands, cogs and extensions area: utilities priority: high High priority status: WIP This is being worked on type: feature A request for or implementation of a new feature
Projects
None yet
8 participants