-
Notifications
You must be signed in to change notification settings - Fork 20
Add on: Automated promotion to voice
Agustin San Roman edited this page Jun 26, 2017
·
1 revision
Gist: https://gist.github.com/asanrom/a9f3b72015830567bee31dd0a2575274
- Rooms - List of rooms where this feature is available
-
Promotion_Command - Pokemon showdown command used to promote.
%s
is replaced by the corresponding username.
/**
* Automated promotion feature for Showdown ChatBot
* Install as an Add-On
*/
'use strict';
const Rooms = ['freevoice']; // here the rooms where this feature is available
const Promotion_Command = "/roomvoice %s";
const Util = require('util');
const Text = Tools('text');
exports.setup = function (App) {
return Tools('add-on').forApp(App).install({
events: {
"userjoin": function (room, by) {
if (Rooms.indexOf(room) >= 0) {
let ident = Text.parseUserIdent(by);
if (!App.parser.equalOrHigherGroup(ident, 'voice')) {
App.bot.sendTo(room, Util.format(Promotion_Command, ident.id));
}
}
},
},
});
};
Showdown ChatBot is distributed under the terms of the MIT License