A powerful and extendable Discord bot, with it's own module system :3 thevoid.cafe/projects/voidy
at develop 572 B view raw
1import type { VoidyClient } from "./VoidyClient"; 2 3export class Logger { 4 private logChannelId?: string; 5 6 constructor(private client: VoidyClient) {} 7 8 public async send(message: string) { 9 if (!this.logChannelId) return; 10 11 try { 12 const loggingChannel = this.client.channels.cache.get(this.logChannelId); 13 if (loggingChannel && loggingChannel.isSendable()) { 14 await loggingChannel.send(message); 15 } 16 } catch {} 17 18 console.log(message); 19 } 20 21 public setChannelId(id: string) { 22 this.logChannelId = id; 23 } 24}