Advertisement
Volcos

Untitled

Sep 25th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. var fs = require('fs');
  2. var selectors;
  3.  
  4. function writeIconCSS() {
  5. fs.appendFile('config/custom.css', selectors);
  6. }
  7.  
  8. exports.commands = {
  9. symbolcolor: function (target, room, user) {
  10. if (!this.can('forcewin')) return false;
  11.  
  12. var args = target.split(',');
  13. if (args.length < 3) return this.parse('/help symbolcolor');
  14. var username = toId(args.shift());
  15. var image = 'color:' + args.shift().trim() + ';';
  16. selectors = '\n\n' + ' #' + toId(args.shift()) + '-userlist-user-' + username + ' em.group';
  17. args.forEach(function (room) {
  18. selectors += ', #' + toId(room) + '-userlist-user-'+ username + ' em.group';
  19. });
  20. selectors += ' { \n' + ' ' + image + '\n }';
  21.  
  22. this.privateModCommand("(" + user.name + " has set an symbol color to " + username + ")");
  23. writeIconCSS();
  24. // Users.get(args[0]).send('|refresh|');
  25. },
  26. symbolcolorhelp: ["/symbolcolor [username], [color], [room 1], [room 2], etc. - Sets an symbol color to a user in chosen rooms."],
  27. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement