|
4 | 4 | from urllib.parse import ParseResult, parse_qs, urlencode, urlparse, urlunparse
|
5 | 5 |
|
6 | 6 | from fastapi.param_functions import Query
|
| 7 | +from fastapi.requests import Request |
7 | 8 | from lnurl.types import LnurlPayMetadata
|
8 | 9 | from pydantic import BaseModel
|
9 |
| -from fastapi.requests import Request |
10 | 10 |
|
11 | 11 | from lnbits.lnurl import encode as lnurl_encode
|
12 | 12 |
|
@@ -37,27 +37,27 @@ class CreateCopilotData(BaseModel):
|
37 | 37 |
|
38 | 38 | class Copilot(BaseModel):
|
39 | 39 | id: str
|
40 |
| - user: str |
| 40 | + user: Optional[str] |
41 | 41 | title: str
|
42 | 42 | lnurl_toggle: int
|
43 |
| - wallet: str |
44 |
| - animation1: str |
45 |
| - animation2: str |
46 |
| - animation3: str |
47 |
| - animation1threshold: str |
48 |
| - animation2threshold: str |
49 |
| - animation3threshold: str |
50 |
| - animation1webhook: str |
51 |
| - animation2webhook: str |
52 |
| - animation3webhook: str |
53 |
| - lnurl_title: str |
| 43 | + wallet: Optional[str] |
| 44 | + animation1: Optional[str] |
| 45 | + animation2: Optional[str] |
| 46 | + animation3: Optional[str] |
| 47 | + animation1threshold: int |
| 48 | + animation2threshold: int |
| 49 | + animation3threshold: int |
| 50 | + animation1webhook: Optional[str] |
| 51 | + animation2webhook: Optional[str] |
| 52 | + animation3webhook: Optional[str] |
| 53 | + lnurl_title: Optional[str] |
54 | 54 | show_message: int
|
55 | 55 | show_ack: int
|
56 |
| - show_price: str |
| 56 | + show_price: Optional[str] |
57 | 57 | amount_made: int
|
58 | 58 | timestamp: int
|
59 | 59 | fullscreen_cam: int
|
60 |
| - iframe_url: str |
| 60 | + iframe_url: Optional[str] |
61 | 61 |
|
62 | 62 | def lnurl(self, req: Request) -> str:
|
63 | 63 | url = req.url_for("copilot.lnurl_response", cp_id=self.id)
|
|
0 commit comments