Page 1 of 1

Replace text from with a command (badwords.conf)?

Posted: Tue Aug 02, 2022 1:43 pm
by NinjaSnickers
Hello, I'm looking for a way to avoid certain words (e.g: !bot_commands) to be displayed for more than the user writing the command. I have been messing around a bit with the "badword"-block trying to replace a command with another command to try to force the command to be sent as a private message to the bot in the channels, but i haven't succeeded and i don't know if it's doable at all or with some modifications, I'll give you an example of what i mean below:

Code: Select all

# A working example, will replace the botcommand with another string for other users

badword channel {
        word !command;
        replace "I'm typing a command!";
}

# What i would like is to be able to force a user to send the botcommand in a /msg BotName
# private message to the bot directly and therefore hide the command in the channel like:

badword channel {
        word !command2;
        replace "PRIVMSG MyIRCBot :!command2";
}
As you probably can guess this just results in the message being translated as is, have been trying to format it in various different ways and have tried "/msg" etc too with no luck. Is this something that's even doable (maybe with some modifications)?

Any tips/suggestions are welcome :) Thanks on beforehand!

Re: Replace text from with a command (badwords.conf)?

Posted: Tue Aug 09, 2022 9:27 am
by CrazyCat
You can't use badword with this way, as the text (message) is modified, not its channel (channel means the destination).
Badword only does a text substitution, not a reorientation.
You'll need a dedicated module to do what you want