EQUENOS / dislash.py

A Python wrapper for discord slash-commands and buttons, designed to extend discord.py.

Home Page:https://dislashpy.readthedocs.io/en/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow for decorator chaining when a decorator modifies the kwargs

dob9601 opened this issue · comments

I've got a decorator that adds an additional kwarg to a function and have been using this with the default discord.py framework. This decorator helps integrate django with discord.py by using the user id in the context to fetch the user object from the django database. However, due to the code shown here:

new_func = CommandParent(
func,
name=name,
description=kwargs.get('description'),
options=kwargs.get('options'),
default_permission=kwargs.get("default_permission", True),
guild_ids=kwargs.get('guild_ids'),
connectors=kwargs.get("connectors"),
auto_sync=kwargs.get("auto_sync", True)
)

That kwarg never actually reaches the function.
Would it be possible to add support for additional custom kwargs by exposing all additional kwargs to the command function?

I'll add custom kwargs support in the nearest patch, thank you for sharing this issue

Additional custom kwargs are now supported in dislash.py v1.2.3