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

refactor: store invokable application commands properly #1107

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3c37179
A draft of the app commands storage refactor
EQUENOS Sep 16, 2023
b650009
Add missing deprecation warnings and properties
EQUENOS Sep 18, 2023
ec3896d
Fix a bad check
EQUENOS Sep 18, 2023
ea1ad65
Fix linting issues
EQUENOS Sep 18, 2023
424ed03
Update docs and add changelog
EQUENOS Sep 18, 2023
a2b0677
Avoid unnecessary generators
EQUENOS Sep 18, 2023
dbd7920
Fix docs references
EQUENOS Sep 18, 2023
e86e5cb
Add errors for ambiguous app command searches
EQUENOS Sep 19, 2023
f80dbf6
First word of the docstring should not be "This"
EQUENOS Sep 19, 2023
4ed930d
docs: group some changelog entries
EQUENOS Sep 22, 2023
192d2b9
chore: rename `AppCommandRegistrationError`
EQUENOS Sep 22, 2023
686bd48
docs: fix references in changelog entries
EQUENOS Sep 22, 2023
8b5916c
docs: hide the `ext.commands` prefix in changelog entries
EQUENOS Sep 22, 2023
88584c7
docs: revert the removal of `ext.commands` prefix
EQUENOS Sep 23, 2023
1f10a8d
fix: subcommands trying to be top level commands
EQUENOS Sep 23, 2023
f5d5d57
chore: remove deprecated undocumented things
EQUENOS Sep 23, 2023
164df50
chore: fix a small linting issue
EQUENOS Sep 23, 2023
0064e9a
chore: replace `warn_deprecated` with `deprecated `
EQUENOS Sep 24, 2023
4736dad
chore: resolve `remove_app_command` nits
EQUENOS Sep 24, 2023
8c6bb90
chore: add suggested typings
EQUENOS Sep 24, 2023
c44806b
docs: fix typos and improve comments
EQUENOS Sep 24, 2023
ef591e6
chore: simplify ambiguity checks
EQUENOS Sep 24, 2023
42c7e6f
docs: explain command location priorities
EQUENOS Sep 25, 2023
9a4d1aa
Make `bot.all_app_commands` a mapping proxy
EQUENOS Nov 3, 2023
55299b2
fix: unintended breaking change (handling `guild_ids=[]`)
EQUENOS Nov 3, 2023
8dc756e
docs: `AppCmdIndex`
EQUENOS Nov 3, 2023
d519711
fix: docs and linting
EQUENOS Nov 3, 2023
413f759
Make `AppCmdIndex` public
EQUENOS Nov 3, 2023
304a829
docs: fix a reference
EQUENOS Nov 3, 2023
63ce007
docs: improve AppCmdIndex docstring
EQUENOS Nov 3, 2023
a580238
docs: small fixes; chore: move `AppCmdIndex` to a different file
EQUENOS Dec 11, 2023
764324a
Merge branch 'master' into refactor/app-command-storage
EQUENOS Dec 11, 2023
ebdeb33
fix: prevent an unintended breaking change
EQUENOS Dec 11, 2023
93880cf
refactor: `remove_app_command` now takes a single `guild_id`
EQUENOS Dec 11, 2023
84eff42
refactor: use `@deprecated` for `add_xxx_command`
EQUENOS Dec 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: remove deprecated undocumented things
  • Loading branch information
EQUENOS committed Sep 23, 2023
commit f5d5d5777a9abb4ca7f6122c28293076b1329d7c
17 changes: 1 addition & 16 deletions disnake/ext/commands/interaction_bot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,6 @@ def command_sync_flags(self) -> CommandSyncFlags:
"""
return CommandSyncFlags._from_value(self._command_sync_flags.value)

def application_commands_iterator(self) -> Iterable[InvokableApplicationCommand]:
warn_deprecated(
"application_commands_iterator is deprecated and will be removed in a future version. "
"Use all_app_commands.values() instead.",
stacklevel=3,
)
return self.all_app_commands.values()

@property
def application_commands(self) -> Set[InvokableApplicationCommand]:
"""Set[:class:`InvokableApplicationCommand`]: A set of all application commands the bot has."""
Expand Down Expand Up @@ -983,15 +975,8 @@ def decorator(
# command synchronisation

def _ordered_unsynced_commands(
self, test_guilds: Optional[Sequence[int]] = MISSING
self
) -> Tuple[List[ApplicationCommand], Dict[int, List[ApplicationCommand]]]:
if test_guilds is not MISSING:
warn_deprecated(
"Argument test_guilds of _ordered_unsynced_commands is deprecated "
"and will be removed in a future version.",
stacklevel=3,
)

global_cmds = []
guilds = {}

Expand Down