diff --git a/.github/workflows/python-style.yml b/.github/workflows/python-style.yml index a0b01c9..86bba1c 100644 --- a/.github/workflows/python-style.yml +++ b/.github/workflows/python-style.yml @@ -8,10 +8,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python 3.7 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.7' @@ -19,4 +19,6 @@ jobs: run: pip install -r requirements.txt -r requirements-dev.txt - name: Check Style - run: black --check dico + run: | + black --check dico + isort -c --profile=black dico \ No newline at end of file diff --git a/dico/api.py b/dico/api.py index 87fc34c..e5563e2 100644 --- a/dico/api.py +++ b/dico/api.py @@ -17,6 +17,8 @@ Attachment, AuditLog, AuditLogEvents, + AutoModerationEventTypes, + AutoModerationRule, Ban, Channel, ChannelTypes, @@ -60,6 +62,7 @@ Sticker, SystemChannelFlags, ThreadMember, + TriggerTypes, User, VerificationLevel, VideoQualityModes, @@ -68,9 +71,6 @@ WelcomeScreen, WelcomeScreenChannel, WidgetStyle, - AutoModerationRule, - AutoModerationEventTypes, - TriggerTypes, ) from .utils import from_emoji, to_image_data, wrap_to_async @@ -269,7 +269,9 @@ def modify_auto_moderation_rule( body["exempt_roles"] = [int(x) for x in exempt_roles] if exempt_channels is not None: body["exempt_channels"] = [int(x) for x in exempt_channels] - resp = self.http.modify_auto_moderation_rule(int(guild), int(auto_moderation_rule_id), **body, reason=reason) + resp = self.http.modify_auto_moderation_rule( + int(guild), int(auto_moderation_rule_id), **body, reason=reason + ) if isinstance(resp, dict): return AutoModerationRule(resp) return wrap_to_async(AutoModerationRule, None, resp, as_create=False) @@ -277,7 +279,9 @@ def modify_auto_moderation_rule( def delete_auto_moderation_rule( self, guild: Guild.TYPING, auto_moderation_rule_id: Snowflake.TYPING ): - return self.http.delete_auto_moderation_rule(int(guild), int(auto_moderation_rule_id)) + return self.http.delete_auto_moderation_rule( + int(guild), int(auto_moderation_rule_id) + ) # Channel diff --git a/dico/model/auto_moderation.py b/dico/model/auto_moderation.py index 1c1d88b..aa7c412 100644 --- a/dico/model/auto_moderation.py +++ b/dico/model/auto_moderation.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Union, Awaitable +from typing import Awaitable, List, Optional, Union from ..base.model import TypeBase from .snowflake import Snowflake diff --git a/docs/conf.py b/docs/conf.py index a5d6a22..06fb3e6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,6 +12,7 @@ # import os import sys + import sphinx_rtd_theme sys.path.insert(0, os.path.abspath("..")) diff --git a/examples/voice.py b/examples/voice.py index 1b3ab97..3c45065 100644 --- a/examples/voice.py +++ b/examples/voice.py @@ -1,6 +1,6 @@ import re -import dico +import dico client = dico.Client("YOUR_BOT_TOKEN") client.on_ready = lambda ready: print(f"Bot ready, with {len(ready.guilds)} guilds.") diff --git a/requirements-dev.txt b/requirements-dev.txt index 00be0c3..1b25def 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,4 @@ sphinx sphinx-press-theme -black \ No newline at end of file +black==23.10.1 +isort==5.13.2 \ No newline at end of file