mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 23:22:56 +00:00
enhancement(lint): Fix lint errors for src/modules/nextdns.ts
Co-authored-by: NeonGamerBot-QK <saahilattud@gmail.com> Signed-off-by: zeon-neon[bot] <136533918+zeon-neon[bot]@users.noreply.github.com>
This commit is contained in:
parent
bf17870113
commit
452c31b84b
1 changed files with 8 additions and 9 deletions
|
|
@ -21,11 +21,10 @@ export interface Device {
|
|||
name: string;
|
||||
}
|
||||
|
||||
export function PrivateDNS(app: ModifiedApp, id:string, channel:string) {
|
||||
fetch(
|
||||
`https://api.nextdns.io/profiles/${id}/logs/stream`,
|
||||
{ headers: { "X-Api-Key": process.env.NEXTDNS_API_KEY } },
|
||||
).then((r) => {
|
||||
export function PrivateDNS(app: ModifiedApp, id: string, channel: string) {
|
||||
fetch(`https://api.nextdns.io/profiles/${id}/logs/stream`, {
|
||||
headers: { "X-Api-Key": process.env.NEXTDNS_API_KEY },
|
||||
}).then((r) => {
|
||||
const reader = r.body?.getReader();
|
||||
const rs = require("stream").Readable();
|
||||
rs._read = async () => {
|
||||
|
|
@ -44,10 +43,10 @@ export function PrivateDNS(app: ModifiedApp, id:string, channel:string) {
|
|||
if (str.includes(":keepalive")) return;
|
||||
console.debug(str);
|
||||
try {
|
||||
let splits = str.split("\n");
|
||||
let id = splits[0].split(/ +/)[1];
|
||||
let data = splits[1].split(":").slice(1).join(":");
|
||||
if (!id || !data) return;
|
||||
let splits = str.split("\n");
|
||||
let id = splits[0].split(/ +/)[1];
|
||||
let data = splits[1].split(":").slice(1).join(":");
|
||||
if (!id || !data) return;
|
||||
const realData: Root = JSON.parse(data);
|
||||
console.log(realData);
|
||||
//@ts-ignore
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue