interactions-py / interactions.py

A highly extensible, easy to use, and feature complete bot framework for Discord
https://interactions-py.github.io/interactions.py/
MIT License
838 stars 184 forks source link

fix/refactor: add missing imports and reorganize some alls #1672

Open AstreaTSS opened 6 months ago

AstreaTSS commented 6 months ago

Pull Request Type

Description

I've recently developed a tool that goes in and makes sure that each __init__.py matches up with the __all__s in files/folders in the same directory as it. For example, if there was a statement like from .channel import GuildText, the program will go in and make sure the __all__ of channel is ("GuildText",), and fixes the import if the __all__ doesn't match up. It also detects if the __init__ isn't importing a file with a __all__ in it and adds it to the import.

This tool is far from ready, but I've gotten it to a state where I could run a run on the interactions.py library. Wouldn't you know it, we are missing some imports, so I made this PR to add them back in. This PR also fixes some other issues I was running into involving the codebase, like GuildMedia not being properly exposed in channel.py.

As a (hopefully good) consequence of this program, __all__ for __init__.pys that have been affected have been put in alphabetical order.

Changes

Related Issues

Test Scenarios

Python Compatibility

Checklist