mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add render_webhook_request method
This commit is contained in:
parent
3a1a666aff
commit
a5fb4ee296
1 changed files with 6 additions and 0 deletions
|
|
@ -21,6 +21,12 @@ class Request(BaseModel):
|
|||
data: Dict[str, Optional[Any]]
|
||||
files: Optional[Dict[str, InputFile]]
|
||||
|
||||
def render_webhook_request(self):
|
||||
return {
|
||||
"method": self.method,
|
||||
**{key: value for key, value in self.data.items() if value is not None},
|
||||
}
|
||||
|
||||
class Config(BaseConfig):
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue