ctcp:ping lol
This commit is contained in:
		@@ -1,6 +1,11 @@
 | 
				
			|||||||
export default client => {
 | 
					export default client => {
 | 
				
			||||||
  client._cmd.set("PRIVMSG", function (msg) { // privmsg
 | 
					  client._cmd.set("PRIVMSG", function (msg) { // privmsg
 | 
				
			||||||
    this.emit("data", msg.params[1] === "\u0001VERSION\u0001" ? ["ctcp:version", this.reply(msg)] : ["message", this.reply(msg)]);
 | 
					    if(msg.params[1] === "\u0001VERSION\u0001")
 | 
				
			||||||
 | 
					      return this.emit("data", ["ctcp:version", this.reply(msg)]);
 | 
				
			||||||
 | 
					    else if(msg.params[1].match(/^\u0001PING .*\u0001/i))
 | 
				
			||||||
 | 
					      return this.emit("data", ["ctcp:ping", this.reply(msg)]);
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      this.emit("data", ["message", this.reply(msg)]);
 | 
				
			||||||
  }.bind(client));
 | 
					  }.bind(client));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  client._cmd.set("NOTICE", function (msg) { // notice
 | 
					  client._cmd.set("NOTICE", function (msg) { // notice
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,4 +9,8 @@ export default self => {
 | 
				
			|||||||
  self.bot.on("ctcp:version", e => {
 | 
					  self.bot.on("ctcp:version", e => {
 | 
				
			||||||
    e.write(`notice ${e.user.nick} :\u0001VERSION ${versions[~~(Math.random() * versions.length)]}\u0001`);
 | 
					    e.write(`notice ${e.user.nick} :\u0001VERSION ${versions[~~(Math.random() * versions.length)]}\u0001`);
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  self.bot.on("ctcp:ping", e => {
 | 
				
			||||||
 | 
					    e.write(`notice ${e.user.nick} :${e.message}`);
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
		Reference in New Issue
	
	Block a user