You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
fromdiscord_interactionsimportverify_key_decorator, SlashCommandapp=Flask(__name__)
sc=SlashCommand(app)
sc.token=environ["BOT_TOKEN"] # also retrieves application client IDsc.guild_id=guild_id# optional, limits all commands on this service to a guild, would also be configurable from each decoratordefget_opts(name):
withopen("options.json") asfreturnjson.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)defwatch():
pass
If this type of behaviour is not in scope I'll start up a separate project to provide this functionality.
The text was updated successfully, but these errors were encountered:
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:
If this type of behaviour is not in scope I'll start up a separate project to provide this functionality.
The text was updated successfully, but these errors were encountered: