-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmodels.py
More file actions
56 lines (51 loc) · 1.56 KB
/
models.py
File metadata and controls
56 lines (51 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from fastapi import Query, Request
from lnurl import encode as lnurl_encode
from pydantic import BaseModel
class CreateCopilotData(BaseModel):
user: str = Query(None)
title: str = Query(None)
lnurl_toggle: int = Query(0)
wallet: str = Query(None)
animation1: str = Query(None)
animation2: str = Query(None)
animation3: str = Query(None)
animation1threshold: int = Query(0)
animation2threshold: int = Query(0)
animation3threshold: int = Query(0)
animation1webhook: str = Query(None)
animation2webhook: str = Query(None)
animation3webhook: str = Query(None)
lnurl_title: str = Query(None)
show_message: int = Query(0)
show_ack: int = Query(0)
show_price: str = Query(None)
amount_made: int = Query(0)
timestamp: int = Query(0)
fullscreen_cam: int = Query(0)
iframe_url: str = Query(None)
class Copilot(BaseModel):
id: str
user: str | None
title: str
lnurl_toggle: int
wallet: str | None
animation1: str | None
animation2: str | None
animation3: str | None
animation1threshold: int
animation2threshold: int
animation3threshold: int
animation1webhook: str | None
animation2webhook: str | None
animation3webhook: str | None
lnurl_title: str | None
show_message: int
show_ack: int
show_price: str | None
amount_made: int
timestamp: int
fullscreen_cam: int
iframe_url: str | None
def lnurl(self, req: Request) -> str:
url = str(req.url_for("copilot.lnurl_response", cp_id=self.id))
return lnurl_encode(url)