Use logger

This commit is contained in:
Albert Portnoy 2023-01-03 20:03:40 -06:00
parent 3f0ebce86e
commit 41699e2f5f
No known key found for this signature in database

View file

@ -1,6 +1,7 @@
import { Injector, webpack } from "replugged";
import { Injector, Logger, webpack } from "replugged";
const inject = new Injector();
const logger = Logger.plugin("PluginTemplate");
export async function start(): Promise<void> {
const typingMod = await webpack.waitForModule<{
@ -15,7 +16,7 @@ export async function start(): Promise<void> {
if (typingMod && getChannelMod) {
inject.instead(typingMod, "startTyping", ([channel]) => {
const channelObj = getChannelMod.getChannel(channel);
console.log(`Typing prevented! Channel: #${channelObj?.name ?? "unknown"} (${channel}).`);
logger.log(`Typing prevented! Channel: #${channelObj?.name ?? "unknown"} (${channel}).`);
});
}
}