feat: make lint happy

This commit is contained in:
2025-01-19 09:35:11 +08:00
parent 3218e1f491
commit f7d2a53a2e
3 changed files with 28 additions and 26 deletions

View File

@@ -1,5 +1,6 @@
import { hmac } from "https://deno.land/x/hmac@v2.0.1/mod.ts";
// deno-lint-ignore no-explicit-any
async function postHttpJson(url: string, body: any) {
const resp = await fetch(url, {
method: "POST",
@@ -59,13 +60,14 @@ export async function sendDingTalkMarkdownMessage(message: DingTalkMarkdownMessa
}, options);
}
// deno-lint-ignore no-explicit-any
export async function sendDingTalkMessage(message: any, options: SendDingTalkMessageOptions) {
let send_url = options.base_url || BASE_DING_TALK_URL;
send_url += "?access_token=" + encodeURIComponent(options.access_token);
if (options.sec_token) {
const timestamp = new Date().getTime();
const timestamp_and_secret = `${timestamp}\n${options.sec_token}`;
const sec_token_sign = hmac("sha256", options.sec_token, timestamp_and_secret, "utf8", "base64");
const sec_token_sign = hmac("sha256", options.sec_token, timestamp_and_secret, "utf8", "base64") as string;
send_url += "&timestamp=" + timestamp;
send_url += "&sign=" + encodeURIComponent(sec_token_sign);
}