Fix minor Logger things

This commit is contained in:
powermaker450 2024-07-26 01:45:57 -04:00
parent 5723abacdd
commit cc3d394b3d
2 changed files with 7 additions and 7 deletions

View file

@ -60,7 +60,7 @@ client.connect().then(async () => {
const SELF = await client.whoami().then((response) => {
return response.userId;
});
logger.log("Our userId is:", SELF);
logger.log("Our userId is:", emp(SELF));
logger.log("Messages from this userId are automatically ignored.");
client.onMessage(async (message) => {
@ -86,7 +86,7 @@ client.connect().then(async () => {
.replace("Please generate: ", "")
.replace("please generate: ", "")
.replace("without", "|");
logger.log("Generating image:", prompt);
logger.log("Generating image:", emp(prompt));
await client.sendMessage({
converseId: message.converseId,
@ -115,7 +115,7 @@ client.connect().then(async () => {
.replace(/(\[(.*?)\])/g, "")
.replace("{BACKEND}", HOST);
const username = await getUsername(HOST, message.author!);
logger.log("Analyzing the image at:", imageData);
logger.log("Analyzing the image at:", emp(imageData));
await client.sendMessage({
converseId: message.converseId,

View file

@ -1,4 +1,4 @@
import chalk, { ChalkFunction } from "chalk";
import chalk from "chalk";
export class Logger {
private _wrn: string;
@ -13,15 +13,15 @@ export class Logger {
}
log(text: any, args?: any): void {
console.log(this._main + text, args);
args ? console.log(this._main + text, args) : console.log(this._main + text);
}
warn(text: any, args?: any): void {
console.warn(this._wrn + this._main + text, args);
args ? console.warn(this._wrn + this._main + text, args) : console.warn(this._wrn + this._main + text);
}
error(text: any, args?: any): void {
console.error(this._err + this._main + text, args);
args ? console.error(this._err + this._main + text, args) : console.error(this._err + this._main + text);
}
}