User:LucyRicardoBOT/chat.js

User:Koabot/chat.js < User:Koabot VIEW SOURCE Note: After saving, you may have to bypass your browser's cache to see the changes.

Chrome - Windows: Hold the Ctrl key and press the F5 key. OS X: Hold both the ⌘ Cmd and ⇧ Shift keys and press the R key. Safari - Hold down the ⇧ Shift key and click the Reload toolbar button. Firefox - Windows: Hold the Ctrl key, and press F5. OS X: Hold the ⌘ Cmd and ⇧ Shift keys, and then press R. Internet Explorer - Hold the Ctrl key, and press F5 (or click the Refresh button). window.logInterval = 86400000; importArticles({   type: 'script',    articles: [        'u:thekorrafanatic:TDLChatBot.js',    ] }); window.colour = {}; /** Mass-PM block script created by Colouratura. * colour.chat * * Literally exists to hold PM blocking code */ window.colour.chat = { _blockPM: function(user) { return new Promise(function(resolve, reject) {           $.ajax({ url: mw.util.wikiScript('index') + '?action=ajax&rs=ChatAjax&method=blockOrBanChat', type: 'post', dataType: 'json', data: { userToBan: user, dir: 'add', token: mw.user.tokens.get('editToken') }               })                .done(function(res) { if (!res.hasOwnProperty('success')) reject(res); if (res.success === true) resolve(true); else reject(res); })               .fail(function(err, stat) { reject(err, stat); });       });    },    blockPM: function(user) { window.colour.chat._blockPM(user).then(           function {                console.log(user + ' was blocked!');            },            function(err, stat) {                console.error(err, stats);            }        ); } }; /** * Blocks PMs on user join * * This is a bot account, no need to PM it. */ if (mw.config.get('wgCanonicalSpecialPageName') === 'Chat') { mainRoom.socket.bind('join', function(event) {       var ev = JSON.parse(event.data);        var username = ev.attrs.name;        var whitelist = [            'C.Syde65',            'Syde_BOT',        ];        if (!whitelist.includes(username))            colour.chat.blockPM(username);    }); } importArticles({    type: 'script',     articles: [         'u:kocka:User:KockaAdmiralac/BotAntiSpam.javascript',     ] });