feat: add logging

This commit is contained in:
xHyroM 2022-10-20 12:42:39 +02:00
parent eff01b65de
commit 04d462ebb1

View file

@ -1,3 +1,5 @@
import { Logger } from "./Logger";
export const getDiscordGuildMembers = async() => { export const getDiscordGuildMembers = async() => {
let oldId; let oldId;
const result: any[] = []; const result: any[] = [];
@ -16,8 +18,12 @@ export const getDiscordGuildMembers = async() => {
result.push(...members.map(m => ({ id: m.id, nickname: m.nick }))); result.push(...members.map(m => ({ id: m.id, nickname: m.nick })));
oldId = members[members.length - 1].id; oldId = members[members.length - 1].id;
Logger.debug(`Fetching guild members - ${result.length}, ${oldId}`);
} }
Logger.debug(`All guild members has been fetched - ${result.length}`);
return result; return result;
} }