Skip to content

App command auto_unregister #907

@BobDotCom

Description

@BobDotCom

Summary

Add a method to automatically unregister commands that are recieved but not in sync with the internal cache

What is the feature request for?

The core library

The Problem

The library is unable to automatically unregister guild commands by default on startup, as it would have to fetch and iterate through all of the bots guilds and that's unrealistic. This change would allow unknown commands to be unregistered when they are received.

The Ideal Solution

This change would add an auto_unregister_commands kwarg to the discord.Bot constructor which would allow sync_commands to be run when an unknown command is received. As an alternative, an auto_register_commands kwarg could be added instead, which would toggle both the aforementioned new functionality and the registration of commands on startup. If this is used, sync_commands may possibly be moved out of on_connect, though it could also stay.

The Current Solution

Users would have to make a custom implementation of this.

Additional Context

This change will be for the feature/command-registration branch if approved.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions