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: add load_extensions method #1529

Closed
wants to merge 6 commits into from
Closed

feat: add load_extensions method #1529

wants to merge 6 commits into from

Conversation

maksims8
Copy link
Contributor

@maksims8 maksims8 commented Aug 12, 2023

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

This commit introduces a new method in which you can overcome manually loading extensions you have in your project down to just one line and therefore allows your project setup time and complexity to be decreased.

Changes

  • Introduces a new method to load extensions without manually looping and loading.

Test Scenarios

Non-recursive (loaded exts.example):

import interactions

intents = interactions.Intents.DEFAULT | interactions.Intents.MESSAGE_CONTENT
client = interactions.Client(intents=intents)

@interactions.listen()
async def on_ready():
    print("Client is ready.")

client.load_extensions("exts") # Folder is located in the root of the project
client.start("TOKEN")

Recursive (loaded exts.example & exts.subdir.example_two):

import interactions

intents = interactions.Intents.DEFAULT | interactions.Intents.MESSAGE_CONTENT
client = interactions.Client(intents=intents)

@interactions.listen()
async def on_ready():
    print("Client is ready.")

client.load_extensions("exts", True) # Folder is located in the root of the project
client.start("TOKEN")

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

maksims8 and others added 6 commits August 10, 2023 16:10
* fix: add avatar_url to user mixins

* fix: add avatar_url property to Mixins

* chore: remove avatar_url from Member class
Signed-off-by: mk; <54314787+m2ksims@users.noreply.github.com>
@maksims8
Copy link
Contributor Author

changing pr as my vscode has glitched with previous pr

@maksims8 maksims8 closed this Aug 12, 2023
@maksims8 maksims8 deleted the load-extensions branch August 12, 2023 19:52
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.

1 participant