Prefix based on env
This commit is contained in:
@@ -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(' ');
|
||||
|
||||
|
Reference in New Issue
Block a user