Coroutine wrapper default arguments
This commit is contained in:
parent
0a05c1e1c1
commit
23b04d6207
@ -14,7 +14,7 @@ __author__ = "Davide Testa"
|
||||
__email__ = "davide@davte.it"
|
||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||
__license__ = "GNU General Public License v3.0"
|
||||
__version__ = "2.3.28"
|
||||
__version__ = "2.3.29"
|
||||
__maintainer__ = "Davide Testa"
|
||||
__contact__ = "t.me/davte"
|
||||
|
||||
|
@ -466,7 +466,7 @@ async def async_wrapper(coroutine, *args1, **kwargs1):
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
```
|
||||
"""
|
||||
async def wrapped_coroutine(*args2, **kwargs2):
|
||||
async def wrapped_coroutine(*args2, bot=None, update=None, user_record=None, **kwargs2):
|
||||
# Update keyword arguments
|
||||
kwargs1.update(kwargs2)
|
||||
# Pass only supported arguments
|
||||
@ -477,7 +477,7 @@ async def async_wrapper(coroutine, *args1, **kwargs1):
|
||||
coroutine
|
||||
).parameters
|
||||
}
|
||||
return await coroutine(*args1, *args2, **kwargs)
|
||||
return await coroutine(*args1, *args2, bot=bot, update=update, user_record=user_record, **kwargs)
|
||||
return wrapped_coroutine
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user