[CONTACT]

[ABOUT]

[POLICY]

weechat bitbot Another another weech

Found at: demu.red:70/blog/024-auto-remove-spammer-bitbot-quotes.md

Title: Auto remove a spammer's bitbot quotes of yourself
Date: 2021-06-28 21:00
Category: weechat
Tags: weechat, IRC, trigger, conf, bitbot
### Another day, another weechat /trigger
As is often the case on the internet, some people are the reason we can't have nice things.
Today's instance of ass hattery involves an instance of [bitbot], its [quote] module, and a trolly user who continually fills the quote db with garbage.
#### TL;DR
Bad user overuses bot quote commands `,grab` and `,qadd nick= not a funny msg` -- both spamming channels with the commands and filling the db with crap.
### Triggers to the rescue
    :::bash
    /trigger addreplace ATriggerNameHere print "" "${server}.${tg_tag_nick} == YourShortNetworkName.BadUserNick && ${tg_message_nocolor} =~ ^,(qadd|grab) ${nick}" "" "/msg -server ${server} BotNick ,qdel ${nick}" "ok"
    /trigger
        ## Pick a trigger name
        addreplace ATriggerNameHere
            print
                ""
                ## fill in the network and user nick after the double equals.
                ## ${nick} could be hard coded for your nick, but this way it works for your current nick.
                "${server}.${tg_tag_nick} == YourShortNetworkName.BadUserNick && ${tg_message_nocolor} =~ ^,(qadd|grab) ${nick}"
                ""
                ## Fill in the bitbot instances nick, see above re nick var.
                "/msg -server ${server} BotNick ,qdel ${nick}"
                "ok"
#### For other tildeverse users
Here is the version you are probably here for ^_-
    :::bash
    /trigger addreplace tilde_no_jan6_quote print "" "${server}.${tg_tag_nick} == tilde.jan6 && ${tg_message_nocolor} =~ ^,(qadd|grab) ${nick}" "" "/msg -server ${server} tildebot ,qdel ${nick}" "ok"
### Explanation
This trigger first matches that the network and nick of a message are for the assigned net, and nick.
Then the message is tested for either quote bot triggers, and your nick.
### Links
[bitbot]  
[quote]  
[bitbot]: https://github.com/jesopo/bitbot
[quote]: https://github.com/jesopo/bitbot/blob/master/modules/quotes.py