(text: string)
| 4 | import { safeGetReplyMessage } from "@utils/safeGetMessages"; |
| 5 | |
| 6 | import { htmlEscape } from "@utils/htmlEscape"; |
| 7 | |
| 8 | async function getIpInfo(query: string): Promise<any> { |
| 9 | if (!query || query.trim() === "") { |
| 10 | return { |
| 11 | status: "fail", |
| 12 | message: "请提供有效的IP地址或域名", |
| 13 | }; |
| 14 | } |
| 15 | |
| 16 | const cleanQuery = query.trim(); |
| 17 | const apiUrl = `http://ip-api.com/json/${encodeURIComponent( |