kamijoutouma

nick

May 3rd, 2014
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // Derplib command file
  3.  
  4. var MM         = module.parent,
  5.     commands = MM.plugin.load('commands');
  6.  
  7. commands.register({
  8.     key: 'nick',
  9.     access: 1,
  10.     description: 'set your nick with this command',
  11.     run: function(req){
  12.         if(req.message.args.length > 0){
  13.             req.user.data.nickname = req.message.args.join(' ').replace(/'#/gi, '"#').replace(/'>/gi, '">').replace(/' /gi, "' ").replace(/\\"#/gi, '"#').replace(/\\">/gi, '">').replace(/\\" /gi, '" ');
  14.             req.write("Your nickname is now "+req.user.data.nickname);
  15.         }else{
  16.             req.write('Your nickname is '+req.user.data.nickname);
  17.         }
  18.     },
  19. });
Advertisement
Add Comment
Please, Sign In to add comment