File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -30,21 +30,26 @@ export const sendAccessLog = async (c: Context, others: boolean) => {
30
30
second : "numeric" ,
31
31
} ) ;
32
32
33
- await sendDiscordWebhook (
34
- webhookURL ,
35
- {
36
- content : c . req . path ,
37
- embeds : [
38
- {
39
- description : `[${ c . req . method } ] ${ c . req . url } - ${ c . res . status } ` ,
40
- color : others ? 0xffff00 : 0x008000 ,
41
- footer : {
42
- text : `${ time } - ${ info . remote . address } ` ,
33
+ const ua = c . req . header ( "user-agent" ) || "Unknown" ;
34
+
35
+ await sendDiscordWebhook ( webhookURL , {
36
+ content : c . req . path ,
37
+ embeds : [
38
+ {
39
+ description : `[${ c . req . method } ] ${ c . req . url } - ${ c . res . status } ` ,
40
+ color : others ? 0xffff00 : 0x008000 ,
41
+ fields : [
42
+ {
43
+ name : "User-Agent" ,
44
+ value : ua ,
43
45
} ,
46
+ ] ,
47
+ footer : {
48
+ text : `${ time } - ${ info . remote . address } ` ,
44
49
} ,
45
- ] ,
46
- } ,
47
- ) ;
50
+ } ,
51
+ ] ,
52
+ } ) ;
48
53
} ;
49
54
50
55
export const sendAPIAccessLog = async (
You can’t perform that action at this time.
0 commit comments