summaryrefslogtreecommitdiff
path: root/modules/commands
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-06-23 07:12:41 -0400
committerAdam <Adam@anope.org>2014-06-23 07:12:41 -0400
commit148b26f687ce85dc01e852a2358b03d493757ada (patch)
treef81ea553d0384ec6063eff45cfaff5aa92aaa1c9 /modules/commands
parent0dba0692f9f88275b7d89d511bf22124217bc4c6 (diff)
Mostly working language string rewrite with new format strings
Diffstat (limited to 'modules/commands')
-rw-r--r--modules/commands/bs_assign.cpp114
-rw-r--r--modules/commands/bs_badwords.cpp144
-rw-r--r--modules/commands/bs_bot.cpp156
-rw-r--r--modules/commands/bs_botlist.cpp25
-rw-r--r--modules/commands/bs_control.cpp52
-rw-r--r--modules/commands/bs_info.cpp42
-rw-r--r--modules/commands/bs_kick.cpp335
-rw-r--r--modules/commands/bs_set.cpp47
-rw-r--r--modules/commands/cs_access.cpp312
-rw-r--r--modules/commands/cs_akick.cpp157
-rw-r--r--modules/commands/cs_ban.cpp99
-rw-r--r--modules/commands/cs_clone.cpp32
-rw-r--r--modules/commands/cs_drop.cpp27
-rw-r--r--modules/commands/cs_enforce.cpp55
-rw-r--r--modules/commands/cs_entrymsg.cpp60
-rw-r--r--modules/commands/cs_flags.cpp83
-rw-r--r--modules/commands/cs_getkey.cpp17
-rw-r--r--modules/commands/cs_info.cpp16
-rw-r--r--modules/commands/cs_invite.cpp51
-rw-r--r--modules/commands/cs_kick.cpp39
-rw-r--r--modules/commands/cs_list.cpp79
-rw-r--r--modules/commands/cs_log.cpp78
-rw-r--r--modules/commands/cs_mode.cpp146
-rw-r--r--modules/commands/cs_register.cpp51
-rw-r--r--modules/commands/cs_seen.cpp70
-rw-r--r--modules/commands/cs_set.cpp439
-rw-r--r--modules/commands/cs_set_misc.cpp16
-rw-r--r--modules/commands/cs_status.cpp109
-rw-r--r--modules/commands/cs_suspend.cpp39
-rw-r--r--modules/commands/cs_sync.cpp42
-rw-r--r--modules/commands/cs_topic.cpp66
-rw-r--r--modules/commands/cs_unban.cpp30
-rw-r--r--modules/commands/cs_updown.cpp84
-rw-r--r--modules/commands/cs_xop.cpp158
-rw-r--r--modules/commands/gl_global.cpp6
-rw-r--r--modules/commands/greet.cpp56
-rw-r--r--modules/commands/help.cpp16
-rw-r--r--modules/commands/hs_del.cpp32
-rw-r--r--modules/commands/hs_group.cpp16
-rw-r--r--modules/commands/hs_list.cpp29
-rw-r--r--modules/commands/hs_off.cpp10
-rw-r--r--modules/commands/hs_on.cpp14
-rw-r--r--modules/commands/hs_request.cpp72
-rw-r--r--modules/commands/hs_set.cpp61
-rw-r--r--modules/commands/ms_cancel.cpp22
-rw-r--r--modules/commands/ms_check.cpp24
-rw-r--r--modules/commands/ms_del.cpp50
-rw-r--r--modules/commands/ms_ignore.cpp34
-rw-r--r--modules/commands/ms_info.cpp85
-rw-r--r--modules/commands/ms_list.cpp36
-rw-r--r--modules/commands/ms_read.cpp54
-rw-r--r--modules/commands/ms_rsend.cpp14
-rw-r--r--modules/commands/ms_send.cpp19
-rw-r--r--modules/commands/ms_sendall.cpp4
-rw-r--r--modules/commands/ms_set.cpp130
-rw-r--r--modules/commands/ms_staff.cpp2
-rw-r--r--modules/commands/ns_access.cpp83
-rw-r--r--modules/commands/ns_ajoin.cpp43
-rw-r--r--modules/commands/ns_alist.cpp16
-rw-r--r--modules/commands/ns_cert.cpp67
-rw-r--r--modules/commands/ns_drop.cpp15
-rw-r--r--modules/commands/ns_getemail.cpp14
-rw-r--r--modules/commands/ns_getpass.cpp16
-rw-r--r--modules/commands/ns_group.cpp106
-rw-r--r--modules/commands/ns_identify.cpp20
-rw-r--r--modules/commands/ns_info.cpp62
-rw-r--r--modules/commands/ns_list.cpp98
-rw-r--r--modules/commands/ns_logout.cpp15
-rw-r--r--modules/commands/ns_recover.cpp35
-rw-r--r--modules/commands/ns_register.cpp93
-rw-r--r--modules/commands/ns_resetpass.cpp18
-rw-r--r--modules/commands/ns_set.cpp321
-rw-r--r--modules/commands/ns_set_misc.cpp10
-rw-r--r--modules/commands/ns_status.cpp5
-rw-r--r--modules/commands/ns_suspend.cpp34
-rw-r--r--modules/commands/os_akill.cpp142
-rw-r--r--modules/commands/os_chankill.cpp11
-rw-r--r--modules/commands/os_config.cpp23
-rw-r--r--modules/commands/os_defcon.cpp25
-rw-r--r--modules/commands/os_dns.cpp149
-rw-r--r--modules/commands/os_forbid.cpp40
-rw-r--r--modules/commands/os_ignore.cpp44
-rw-r--r--modules/commands/os_info.cpp32
-rw-r--r--modules/commands/os_jupe.cpp18
-rw-r--r--modules/commands/os_kick.cpp24
-rw-r--r--modules/commands/os_kill.cpp10
-rw-r--r--modules/commands/os_list.cpp31
-rw-r--r--modules/commands/os_login.cpp18
-rw-r--r--modules/commands/os_logsearch.cpp33
-rw-r--r--modules/commands/os_mode.cpp22
-rw-r--r--modules/commands/os_modinfo.cpp20
-rw-r--r--modules/commands/os_module.cpp39
-rw-r--r--modules/commands/os_news.cpp47
-rw-r--r--modules/commands/os_noop.cpp16
-rw-r--r--modules/commands/os_oline.cpp12
-rw-r--r--modules/commands/os_oper.cpp43
-rw-r--r--modules/commands/os_reload.cpp9
-rw-r--r--modules/commands/os_session.cpp130
-rw-r--r--modules/commands/os_set.cpp76
-rw-r--r--modules/commands/os_shutdown.cpp19
-rw-r--r--modules/commands/os_stats.cpp84
-rw-r--r--modules/commands/os_svs.cpp47
-rw-r--r--modules/commands/os_sxline.cpp255
-rw-r--r--modules/commands/os_update.cpp5
104 files changed, 3066 insertions, 3485 deletions
diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp
index fe7938fc8..6fc66f43c 100644
--- a/modules/commands/bs_assign.cpp
+++ b/modules/commands/bs_assign.cpp
@@ -18,7 +18,7 @@ class CommandBSAssign : public Command
CommandBSAssign(Module *creator) : Command(creator, "botserv/assign", 2, 2)
{
this->SetDesc(_("Assigns a bot to a channel"));
- this->SetSyntax(_("\037channel\037 \037nick\037"));
+ this->SetSyntax(_("\037channel\037 \037nickname\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
@@ -32,36 +32,42 @@ class CommandBSAssign : public Command
return;
}
- ChanServ::Channel *ci = ChanServ::Find(params[0]);
+ ChanServ::Channel *ci = ChanServ::Find(chan);
if (ci == NULL)
{
- source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
+ source.Reply(_("Channel \002{0}\002 isn't registered."), chan);
return;
}
BotInfo *bi = BotInfo::Find(nick, true);
if (!bi)
{
- source.Reply(BOT_DOES_NOT_EXIST, nick.c_str());
+ source.Reply(_("Bot \002{0}\002 does not exist."), nick);
return;
}
ChanServ::AccessGroup access = source.AccessFor(ci);
- if (ci->HasExt("BS_NOBOT") || (!access.HasPriv("ASSIGN") && !source.HasPriv("botserv/administration")))
+ if (!access.HasPriv("ASSIGN") && !source.HasPriv("botserv/administration"))
{
- source.Reply(ACCESS_DENIED);
+ source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "ASSIGN", ci->name);
+ return;
+ }
+
+ if (ci->HasExt("BS_NOBOT"))
+ {
+ source.Reply(_("Access denied. \002{0}\002 may not have a bot assigned to it because a Services Operator has disallowed it."), ci->name);
return;
}
if (bi->oper_only && !source.HasPriv("botserv/administration"))
{
- source.Reply(ACCESS_DENIED);
+ source.Reply(_("Access denied. Bot \002{0}\002 is for operators only."), bi->nick);
return;
}
if (ci->bi == bi)
{
- source.Reply(_("Bot \002%s\002 is already assigned to channel \002%s\002."), ci->bi->nick.c_str(), chan.c_str());
+ source.Reply(_("Bot \002{0}\002 is already assigned to \002{1}\002."), ci->bi->nick, ci->name);
return;
}
@@ -69,16 +75,20 @@ class CommandBSAssign : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << bi->nick;
bi->Assign(source.GetUser(), ci);
- source.Reply(_("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), ci->name.c_str());
+ source.Reply(_("Bot \002{0}\002 has been assigned to \002{1}\002."), bi->nick, ci->name);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Assigns a bot pointed out by nick to a channel. You\n"
- "can then configure the bot for the channel so it fits\n"
- "your needs."));
+ source.Reply(_("Assigns the bot \037nickname\037 to \037channel\037."
+ " You can then configure the bot for the channel so it fits your needs.\n"
+ "\n"
+ "Use of this command requires the \002{0}\002 privilege on \037channel\037."
+ "\n"
+ "Example:\n"
+ " {command} #anope Botox\n"
+ " Assigns the bot Botox to #anope.\n"),
+ "ASSIGN", "command"_kw = source.command);
return true;
}
};
@@ -94,29 +104,31 @@ class CommandBSUnassign : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
+ const Anope::string &chan = params[0];
+
if (Anope::ReadOnly)
{
source.Reply(_("Sorry, bot assignment is temporarily disabled."));
return;
}
- ChanServ::Channel *ci = ChanServ::Find(params[0]);
+ ChanServ::Channel *ci = ChanServ::Find(chan);
if (ci == NULL)
{
- source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
+ source.Reply(_("Channel \002{0}\002 isn't registered."), chan);
return;
}
ChanServ::AccessGroup access = source.AccessFor(ci);
if (!source.HasPriv("botserv/administration") && !access.HasPriv("ASSIGN"))
{
- source.Reply(ACCESS_DENIED);
+ source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "ASSIGN", ci->name);
return;
}
if (!ci->bi)
{
- source.Reply(BOT_NOT_ASSIGNED);
+ source.Reply(_("There is no bot assigned to \002{0}\002."), ci->name);
return;
}
@@ -129,19 +141,22 @@ class CommandBSUnassign : public Command
bool override = !access.HasPriv("ASSIGN");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << ci->bi->nick;
+ BotInfo *bi = ci->bi;
ci->bi->UnAssign(source.GetUser(), ci);
- source.Reply(_("There is no bot assigned to %s anymore."), ci->name.c_str());
+ source.Reply(_("Bot \002{0}\002 has been unassigned from \002{1}\002."), bi->nick, ci->name);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Unassigns a bot from a channel. When you use this command,\n"
- "the bot won't join the channel anymore. However, bot\n"
- "configuration for the channel is kept, so you will always\n"
- "be able to reassign a bot later without having to reconfigure\n"
- "it entirely."));
+ source.Reply(_("Unassigns a bot from \037channel\037."
+ "Bot configuration is kept, so you will always be able to reassign a bot later without losing your settings.\n"
+ "\n"
+ "Use of this command requires the \002{0}\002 privilege on \037channel\037."
+ "\n"
+ "Example:\n"
+ " {command} #anope\n"
+ " Unassigns the current bot from #anope.\n"),
+ "ASSIGN", "command"_kw = source.command);
return true;
}
};
@@ -157,18 +172,13 @@ class CommandBSSetNoBot : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
- ChanServ::Channel *ci = ChanServ::Find(params[0]);
+ const Anope::string &chan = params[0];
const Anope::string &value = params[1];
- if (Anope::ReadOnly)
- {
- source.Reply(_("Sorry, bot modification is temporarily disabled."));
- return;
- }
-
+ ChanServ::Channel *ci = ChanServ::Find(chan);
if (ci == NULL)
{
- source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
+ source.Reply(_("Channel \002{0}\002 isn't registered."), chan);
return;
}
@@ -179,14 +189,14 @@ class CommandBSSetNoBot : public Command
ci->Extend<bool>("BS_NOBOT");
if (ci->bi)
ci->bi->UnAssign(source.GetUser(), ci);
- source.Reply(_("No-bot mode is now \002on\002 on channel %s."), ci->name.c_str());
+ source.Reply(_("No-bot mode is now \002on\002 for \002{0}\002."), ci->name);
}
else if (value.equals_ci("OFF"))
{
Log(LOG_ADMIN, source, this, ci) << "to disable nobot";
ci->Shrink<bool>("BS_NOBOT");
- source.Reply(_("No-bot mode is now \002off\002 on channel %s."), ci->name.c_str());
+ source.Reply(_("No-bot mode is now \002off\002 for \002{0}\002."), ci->name);
}
else
this->OnSyntaxError(source, source.command);
@@ -194,11 +204,13 @@ class CommandBSSetNoBot : public Command
bool OnHelp(CommandSource &source, const Anope::string &) override
{
- this->SendSyntax(source);
- source.Reply(_(" \n"
- "This option makes a channel be unassignable. If a bot\n"
- "is already assigned to the channel, it is unassigned\n"
- "automatically when you enable the option."));
+ source.Reply(_("If no-bot is set on a channel, then the channel will be unabled to have a bot assigned to it."
+ " If a bot is already assigned to the channel, it is unassigned automatically when no-bot is enabled."
+ "\n"
+ "Example:\n"
+ " {command} #anope on\n"
+ " Prevents a service bot from being assigned to #anope.\n"),
+ "command"_kw = source.command);
return true;
}
};
@@ -217,7 +229,9 @@ class BSAssign : public Module
BSAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
, EventHook<Event::Invite>("OnInvite")
, EventHook<Event::BotInfoEvent>("OnBotInfoEvent")
+
, nobot(this, "BS_NOBOT")
+
, commandbsassign(this)
, commandbsunassign(this)
, commandbssetnobot(this)
@@ -227,30 +241,36 @@ class BSAssign : public Module
void OnInvite(User *source, Channel *c, User *targ) override
{
BotInfo *bi;
- if (Anope::ReadOnly || !c->ci || targ->server != Me || !(bi = dynamic_cast<BotInfo *>(targ)))
+ if (Ano