1
- from fastapi .param_functions import Query
1
+ from fastapi import Query , Reuqest
2
+ from lnurl .types import LnurlPayMetadata
2
3
from pydantic import BaseModel
3
- from starlette .requests import Request
4
4
5
5
from lnbits .lnurl import encode as lnurl_encode
6
6
@@ -13,9 +13,9 @@ class CreateCopilotData(BaseModel):
13
13
animation1 : str = Query (None )
14
14
animation2 : str = Query (None )
15
15
animation3 : str = Query (None )
16
- animation1threshold : int = Query (None )
17
- animation2threshold : int = Query (None )
18
- animation3threshold : int = Query (None )
16
+ animation1threshold : int = Query (0 )
17
+ animation2threshold : int = Query (0 )
18
+ animation3threshold : int = Query (0 )
19
19
animation1webhook : str = Query (None )
20
20
animation2webhook : str = Query (None )
21
21
animation3webhook : str = Query (None )
@@ -27,33 +27,31 @@ class CreateCopilotData(BaseModel):
27
27
timestamp : int = Query (0 )
28
28
fullscreen_cam : int = Query (0 )
29
29
iframe_url : str = Query (None )
30
- success_url : str = Query (None )
31
30
32
31
33
- class Copilots (BaseModel ):
32
+ class Copilot (BaseModel ):
34
33
id : str
35
- user : str = Query (None )
36
- title : str = Query (None )
37
- lnurl_toggle : int = Query (0 )
38
- wallet : str = Query (None )
39
- animation1 : str = Query (None )
40
- animation2 : str = Query (None )
41
- animation3 : str = Query (None )
42
- animation1threshold : int = Query (None )
43
- animation2threshold : int = Query (None )
44
- animation3threshold : int = Query (None )
45
- animation1webhook : str = Query (None )
46
- animation2webhook : str = Query (None )
47
- animation3webhook : str = Query (None )
48
- lnurl_title : str = Query (None )
49
- show_message : int = Query (0 )
50
- show_ack : int = Query (0 )
51
- show_price : str = Query (None )
52
- amount_made : int = Query (0 )
53
- timestamp : int = Query (0 )
54
- fullscreen_cam : int = Query (0 )
55
- iframe_url : str = Query (None )
56
- success_url : str = Query (None )
34
+ user : Optional [str ]
35
+ title : str
36
+ lnurl_toggle : int
37
+ wallet : Optional [str ]
38
+ animation1 : Optional [str ]
39
+ animation2 : Optional [str ]
40
+ animation3 : Optional [str ]
41
+ animation1threshold : int
42
+ animation2threshold : int
43
+ animation3threshold : int
44
+ animation1webhook : Optional [str ]
45
+ animation2webhook : Optional [str ]
46
+ animation3webhook : Optional [str ]
47
+ lnurl_title : Optional [str ]
48
+ show_message : int
49
+ show_ack : int
50
+ show_price : Optional [str ]
51
+ amount_made : int
52
+ timestamp : int
53
+ fullscreen_cam : int
54
+ iframe_url : Optional [str ]
57
55
58
56
def lnurl (self , req : Request ) -> str :
59
57
url = req .url_for ("copilot.lnurl_response" , cp_id = self .id )
0 commit comments