-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Would it be in scope for this project to add a decorator to update Discord with changes to slash commands when the flask service is started/reloaded in debug mode for faster development? There would likely need to be some way to store bot token as authentication in the flask app, maybe a wrapper of some kind. as an example:
from discord_interactions import verify_key_decorator, SlashCommand
app = Flask(__name__)
sc = SlashCommand(app)
sc.token = environ["BOT_TOKEN"] # also retrieves application client ID
sc.guild_id = guild_id # optional, limits all commands on this service to a guild, would also be configurable from each decorator
def get_opts(name):
with open("options.json") as f
return json.load(f)[name]
@app.route("/", methods=["POST"])
@verify_key_decorator(PUBKEY) # could be implicit with inclusion of SlashCommand.command
@sc.command(name="watch", description=long_desc, options=get_opts("watch")) # , guild_id=guild_id)
def watch():
passIf this type of behaviour is not in scope I'll start up a separate project to provide this functionality.
Metadata
Metadata
Assignees
Labels
No labels