feat: make lint happy
This commit is contained in:
@@ -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 += "×tamp=" + timestamp;
|
||||
send_url += "&sign=" + encodeURIComponent(sec_token_sign);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user