ctcp.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00029 #include "ctcp.h"
00030
00034 CTCP::CTCP(BotKernel*b)
00035 {
00036 this->author = "eponyme";
00037 this->description = "CTCP Answering";
00038 this->version = VERSION;
00039 this->name = "ctcp";
00040 this->bindFunction("PING",IN_FREE_COMMAND_HANDLER,"ctcp_ping",0,10);
00041 this->bindFunction("VERSION",IN_FREE_COMMAND_HANDLER,"ctcp_version",0,10);
00042 }
00043
00044 extern "C"
00045 {
00046 Plugin *contruct_ctcp(BotKernel*b)
00047 {
00048 return new CTCP(b);
00049 }
00050 void destroy_ctcp(Plugin*p)
00051 {
00052 delete p;
00053 }
00054 bool ctcp_ping (Message*m,Plugin*p,BotKernel*b)
00055 {
00056 b->send(IRCProtocol::sendNotice(m->getNickSender(),"PING " + m->getPart(4)));
00057 return true;
00058 }
00059 bool ctcp_version (Message*m,Plugin*p,BotKernel*b)
00060 {
00061 b->send(IRCProtocol::sendNotice(m->getNickSender(),""+b->getVersion()+""));
00062 return true;
00063 }
00064 }