Prefix based on env

This commit is contained in:
2023-09-18 22:59:38 -06:00
parent f22627e8cf
commit d34ff00dac

View File

@@ -8,6 +8,9 @@ import { DomainrproxyService } from 'src/domainrproxy/domainrproxy.service';
export class IrcbotService {
private readonly socket: TLSSocket;
private readonly client: irc.Client;
private readonly prefix: string =
process.env.NODE_ENV === 'production' ? '.' : '?';
private readonly logger: Logger = new Logger(IrcbotService.name);
constructor(
@@ -36,8 +39,7 @@ export class IrcbotService {
this.client.on('message', async (message) => {
console.log(message);
if (message.to !== channel) return;
if (message.message[0] !== '.') return;
this.logger.verbose(`Handling ${message.message}`);
if (message.message[0] !== this.prefix) return;
const [command, ...args] = message.message.substring(1).split(' ');