mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
Exclude local variables
This commit is contained in:
parent
adb8d8c17a
commit
3b416a1e0e
1 changed files with 4 additions and 1 deletions
|
|
@ -4,4 +4,7 @@ DEFAULT_FILTER = ['self']
|
||||||
def generate_payload(exclude=None, **kwargs):
|
def generate_payload(exclude=None, **kwargs):
|
||||||
if exclude is None:
|
if exclude is None:
|
||||||
exclude = []
|
exclude = []
|
||||||
return {key: value for key, value in kwargs.items() if key not in exclude + DEFAULT_FILTER and value}
|
return {key: value for key, value in kwargs.items() if
|
||||||
|
key not in exclude + DEFAULT_FILTER
|
||||||
|
and value
|
||||||
|
and not key.startswith('_')}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue