Add Channel types support #100

Merged
Chiggy-Playz merged 4 commits from ChannelTypes into 2.0 2021-10-13 16:34:13 +00:00
Chiggy-Playz commented 2021-10-13 08:47:08 +00:00 (Migrated from github.com)

Summary

Adds support for channel_types in the option (Allows to restrict CHANNEL slash command options to specific channel types).

Note: Separates only TextChannel, VoiceChannel, Threads and StageChannels. Further separation (news, game channnels etc) is not done.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)
## Summary Adds support for [channel_types](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure) in the option (Allows to restrict `CHANNEL` slash command options to specific channel types). Note: Separates only TextChannel, VoiceChannel, Threads and StageChannels. Further separation (news, game channnels etc) is not done. ## Checklist <!-- Put an x inside [ ] to check it, like so: [x] --> - [x] If code changes were made then they have been tested. - [ ] I have updated the documentation to reflect the changes. - [x] This PR fixes an issue. - [ ] This PR adds something new (e.g. new method or parameters). - [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed) - [ ] This PR is **not** a code change (e.g. documentation, README, ...)
Gnome-py (Migrated from github.com) requested changes 2021-10-13 15:50:22 +00:00
Gnome-py (Migrated from github.com) left a comment

Good idea, needs some changes before merge though.

Good idea, needs some changes before merge though.
Gnome-py (Migrated from github.com) commented 2021-10-13 15:49:35 +00:00

Please undo this change, it seems to be #98

Please undo this change, it seems to be #98
@ -1265,12 +1273,19 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
for python_type, discord_type in application_option_type_lookup.items():
Gnome-py (Migrated from github.com) commented 2021-10-13 15:47:27 +00:00

Please use descriptive variable names here

Please use descriptive variable names here
Gnome-py (Migrated from github.com) commented 2021-10-13 15:48:20 +00:00

If I am not mistaken, you can just check if all of the annotation args are in application_option_channel_types

If I am not mistaken, you can just check if all of the annotation args are in `application_option_channel_types`
Chiggy-Playz (Migrated from github.com) reviewed 2021-10-13 16:31:48 +00:00
@ -1265,12 +1273,19 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
for python_type, discord_type in application_option_type_lookup.items():
Chiggy-Playz (Migrated from github.com) commented 2021-10-13 16:31:47 +00:00

Fixed in e84cef2

Fixed in e84cef2
Chiggy-Playz (Migrated from github.com) reviewed 2021-10-13 16:32:08 +00:00
@ -1265,12 +1273,19 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
for python_type, discord_type in application_option_type_lookup.items():
Chiggy-Playz (Migrated from github.com) commented 2021-10-13 16:32:08 +00:00

Fixed in e84cef2

Fixed in e84cef2
Chiggy-Playz (Migrated from github.com) reviewed 2021-10-13 16:32:15 +00:00
Chiggy-Playz (Migrated from github.com) commented 2021-10-13 16:32:15 +00:00

Fixed in e84cef2

Fixed in e84cef2
Sign in to join this conversation.
No description provided.