Closed ghost closed 10 years ago
Every time someone speak (on('speak'...), verify if there is a link to another room with a regex, if so, then boot him if he is not in a moderator list...
Ho wait, I just rewrote your question.
I actually this available on my Mod Tools bookmarklet. Here is the regex I use:
if(window.izzmo.boot_linkers && d.text.search(/https?:\/\/(www.)?(((tt|turntable)\.fm)|(plug\.dj))(\/[a-zA-Z0-9\-\_]*)*\/?/ig) >= 0 && window.izzmo.ttObj.isMod() && !window.izzmo.ttObj.isMod(d.userid)) {
window.izzmo.socket({
api: 'room.boot_user',
roomid: window.izzmo.ttObj.roomId,
target_userid: d.userid,
reason: 'Please do not link to other turntable rooms.'
});
You can hopefully interpret and integrate it into your bot =)
ok, what event handler should I use on top of the code.
As @alaingilbert said, use bot.on('speak', function(e) { ... });
Thank You so much.
How can I make my bot boot listeners, who posts a link to another room, when they are not a moderator?