mirror of
https://github.com/anope/anope.git
synced 2026-07-08 05:43:13 +02:00
Added command aliases
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
class CommandCSBan : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSBan(const Anope::string &cname) : Command(cname, 2, 3)
|
||||
CommandCSBan(const Anope::string &cname) : Command("BAN", 2, 3)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -96,16 +96,15 @@ class CommandCSBan : public Command
|
||||
|
||||
class CSBan : public Module
|
||||
{
|
||||
CommandCSBan commandcsban, commandcskb;
|
||||
CommandCSBan commandcsban;
|
||||
|
||||
public:
|
||||
CSBan(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator), commandcsban("BAN"), commandcskb("KB")
|
||||
CSBan(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator), commandcsban("BAN")
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetType(CORE);
|
||||
|
||||
this->AddCommand(ChanServ, &commandcsban);
|
||||
this->AddCommand(ChanServ, &commandcskb);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
class CommandCSKick : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSKick(const Anope::string &cname) : Command(cname, 2, 3)
|
||||
CommandCSKick() : Command("KICK", 2, 3)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -82,16 +82,15 @@ class CommandCSKick : public Command
|
||||
|
||||
class CSKick : public Module
|
||||
{
|
||||
CommandCSKick commandcskick, commandcsk;
|
||||
CommandCSKick commandcskick;
|
||||
|
||||
public:
|
||||
CSKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator), commandcskick("KICK"), commandcsk("K")
|
||||
CSKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetType(CORE);
|
||||
|
||||
this->AddCommand(ChanServ, &commandcskick);
|
||||
this->AddCommand(ChanServ, &commandcsk);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class CommandCSSASet : public Command
|
||||
for (std::vector<Anope::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it)
|
||||
cmdparams += " " + *it;
|
||||
Log(LOG_ADMIN, u, this, ci) << params[1] << " " << cmdparams;
|
||||
mod_run_cmd(ChanServ, u, c, params[1], cmdparams);
|
||||
mod_run_cmd(ChanServ, u, c, params[1], cmdparams, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ class CommandCSSet : public Command
|
||||
Anope::string cmdparams = ci->name;
|
||||
for (std::vector<Anope::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it)
|
||||
cmdparams += " " + *it;
|
||||
mod_run_cmd(ChanServ, u, c, params[1], cmdparams);
|
||||
mod_run_cmd(ChanServ, u, c, params[1], cmdparams, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
class CommandNSIdentify : public Command
|
||||
{
|
||||
public:
|
||||
CommandNSIdentify(const Anope::string &cname) : Command(cname, 1, 2)
|
||||
CommandNSIdentify() : Command("IDENTIFY", 1, 2)
|
||||
{
|
||||
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
|
||||
}
|
||||
@@ -109,23 +109,21 @@ class CommandNSIdentify : public Command
|
||||
|
||||
void OnServHelp(User *u)
|
||||
{
|
||||
if (this->name.equals_ci("IDENTIFY"))
|
||||
u->SendMessage(NickServ, NICK_HELP_CMD_IDENTIFY);
|
||||
u->SendMessage(NickServ, NICK_HELP_CMD_IDENTIFY);
|
||||
}
|
||||
};
|
||||
|
||||
class NSIdentify : public Module
|
||||
{
|
||||
CommandNSIdentify commandnsidentify, commandnsid;
|
||||
CommandNSIdentify commandnsidentify;
|
||||
|
||||
public:
|
||||
NSIdentify(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator), commandnsidentify("IDENTIFY"), commandnsid("ID")
|
||||
NSIdentify(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetType(CORE);
|
||||
|
||||
this->AddCommand(NickServ, &commandnsidentify);
|
||||
this->AddCommand(NickServ, &commandnsid);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class CommandNSSASet : public Command
|
||||
Log(LOG_ADMIN, u, this) << params[1] << " " << cmdparams;
|
||||
else
|
||||
Log(LOG_ADMIN, u, this) << params[1] << " for " << params[0];
|
||||
mod_run_cmd(NickServ, u, c, params[1], cmdparams);
|
||||
mod_run_cmd(NickServ, u, c, params[1], cmdparams, false);
|
||||
}
|
||||
else
|
||||
u->SendMessage(NickServ, NICK_SASET_UNKNOWN_OPTION, cmd.c_str());
|
||||
|
||||
@@ -54,7 +54,7 @@ class CommandNSSet : public Command
|
||||
Log(LOG_COMMAND, u, this) << params[0] << " " << cmdparams;
|
||||
else
|
||||
Log(LOG_COMMAND, u, this) << params[0];
|
||||
mod_run_cmd(NickServ, u, c, params[0], cmdparams);
|
||||
mod_run_cmd(NickServ, u, c, params[0], cmdparams, false);
|
||||
}
|
||||
else
|
||||
u->SendMessage(NickServ, NICK_SET_UNKNOWN_OPTION, params[0].c_str());
|
||||
|
||||
@@ -205,14 +205,9 @@ class OSDefcon : public Module
|
||||
return EVENT_CONTINUE;
|
||||
}
|
||||
|
||||
EventReturn OnPreCommandRun(User *u, BotInfo *bi, const Anope::string &command, const Anope::string &message, Command *c)
|
||||
EventReturn OnPreCommandRun(User *u, BotInfo *bi, Anope::string &command, Anope::string &message, bool fantasy)
|
||||
{
|
||||
if (!c)
|
||||
{
|
||||
if (CheckDefCon(DEFCON_SILENT_OPER_ONLY) && !is_oper(u))
|
||||
return EVENT_STOP;
|
||||
}
|
||||
if ((CheckDefCon(DEFCON_OPER_ONLY) || CheckDefCon(DEFCON_SILENT_OPER_ONLY)) && !is_oper(u))
|
||||
if (!is_oper(u) && CheckDefCon(DEFCON_OPER_ONLY) || CheckDefCon(DEFCON_SILENT_OPER_ONLY))
|
||||
{
|
||||
if (!CheckDefCon(DEFCON_SILENT_OPER_ONLY))
|
||||
u->SendMessage(bi, OPER_DEFCON_DENIED);
|
||||
|
||||
Reference in New Issue
Block a user