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

Add loading of custom modules #245

Merged
merged 3 commits into from
Apr 19, 2024
Merged

Add loading of custom modules #245

merged 3 commits into from
Apr 19, 2024

Conversation

ikagod
Copy link
Collaborator

@ikagod ikagod commented Apr 14, 2024

This PR introduces a new way for users to load their own - or modified versions of the official - ikabot modules.

Users will simply select the Load custom ikabot module option under the Options / Settings page of the main menu and then they will be presented with a list of previously loaded custom modules, and an option to add new custom modules. The data for the module locations is saved under the 'shared' key in the session data (making is lobby-account specific).
If a module is no longer present (if the path no longer exists) then it is removed from the list of known custom modules.

Also made main menu refresh on hitting enter.

@ikagod ikagod changed the title Add loading of custom modules function Add loading of custom modules Apr 14, 2024
@susikaman
Copy link
Contributor

This idea has been thrown around for quite some time, great to see it finally alive! It seems to load the function just fine, although the task name goes by the "loadCustomModule" instead of the loaded module's name. But that's honestly pretty minor, as the task update does get updated just fine and that should be enough information for identifying a task imo.

I was expecting something like automatically scanning for .py files from a separate folder within Ikabot for listing modules which could be added. But by typing in the full path, we can just add modules/functions from anywhere which is pretty neat! Perhaps we could later add an alternative way of importing modules from the web as well, such as Github or Pastebin for example.

The solution of saving the module's in the userfile is great, it could be a pain in the ass to import multiple models into Ikabot especially with multiple accounts, but having them permanently save the possibly complicated path makes it worth the while.

The enter-to-refresh is just perfect! I've been using the update.py function for that, never bothered to pay more thought for it since it worked well enough. Refresh by enter is just as it should've always been! Excellent addition, there's not much more to it honestly.

Just tested the PR and it seems to work just as intended. Windows & Python 3.10

@ElieTaillard ElieTaillard added this to the 7.0.1 milestone Apr 19, 2024
@ElieTaillard ElieTaillard added the release notes Items are likely to be highlighted in the release notes. label Apr 19, 2024
@ElieTaillard ElieTaillard merged commit c0ea781 into master Apr 19, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes Items are likely to be highlighted in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants