mirror of
https://github.com/anope/anope.git
synced 2026-07-03 17:23:14 +02:00
Moved the language strings which are only used once
out of the core and into the modules that use them.
This commit is contained in:
+106
-43
@@ -31,35 +31,35 @@ class CommandBSSet : public Command
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
source.Reply(BOT_SET_DISABLED);
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
else if (u->Account()->HasCommand("botserv/set/private") && option.equals_ci("PRIVATE"))
|
||||
{
|
||||
BotInfo *bi;
|
||||
|
||||
if (!(bi = findbot(chan)))
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, chan.c_str());
|
||||
source.Reply(LanguageString::BOT_DOES_NOT_EXIST, chan.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bi->SetFlag(BI_PRIVATE);
|
||||
source.Reply(BOT_SET_PRIVATE_ON, bi->nick.c_str());
|
||||
source.Reply(_("Private mode of bot %s is now \002\002."), bi->nick.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bi->UnsetFlag(BI_PRIVATE);
|
||||
source.Reply(BOT_SET_PRIVATE_OFF, bi->nick.c_str());
|
||||
source.Reply(_("Private mode of bot %s is now \002\002."), bi->nick.c_str());
|
||||
}
|
||||
else
|
||||
SyntaxError(source, "SET PRIVATE", BOT_SET_PRIVATE_SYNTAX);
|
||||
SyntaxError(source, "SET PRIVATE", _("SET \037botname\037 PRIVATE {\037ON|\037}"));
|
||||
return MOD_CONT;
|
||||
}
|
||||
else if (!(ci = cs_findchan(chan)))
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str());
|
||||
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, chan.c_str());
|
||||
else if (!u->Account()->HasPriv("botserv/administration") && !check_access(u, ci, CA_SET))
|
||||
source.Reply(ACCESS_DENIED);
|
||||
source.Reply(LanguageString::ACCESS_DENIED);
|
||||
else
|
||||
{
|
||||
bool override = !check_access(u, ci, CA_SET);
|
||||
@@ -70,60 +70,60 @@ class CommandBSSet : public Command
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
ci->botflags.SetFlag(BS_DONTKICKOPS);
|
||||
source.Reply(BOT_SET_DONTKICKOPS_ON, ci->name.c_str());
|
||||
source.Reply(_("Bot \002won't kick ops\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_DONTKICKOPS);
|
||||
source.Reply(BOT_SET_DONTKICKOPS_OFF, ci->name.c_str());
|
||||
source.Reply(_("Bot \002will kick ops\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
SyntaxError(source, "SET DONTKICKOPS", BOT_SET_DONTKICKOPS_SYNTAX);
|
||||
SyntaxError(source, "SET DONTKICKOPS", _("SET \037channel\037 DONTKICKOPS {\037ON|\037}"));
|
||||
}
|
||||
else if (option.equals_ci("DONTKICKVOICES"))
|
||||
{
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
ci->botflags.SetFlag(BS_DONTKICKVOICES);
|
||||
source.Reply(BOT_SET_DONTKICKVOICES_ON, ci->name.c_str());
|
||||
source.Reply(_("Bot \002won't kick voices\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_DONTKICKVOICES);
|
||||
source.Reply(BOT_SET_DONTKICKVOICES_OFF, ci->name.c_str());
|
||||
source.Reply(_("Bot \002will kick voices\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
SyntaxError(source, "SET DONTKICKVOICES", BOT_SET_DONTKICKVOICES_SYNTAX);
|
||||
SyntaxError(source, "SET DONTKICKVOICES", _("SET \037channel\037 DONTKICKVOICES {\037ON|\037}"));
|
||||
}
|
||||
else if (option.equals_ci("FANTASY"))
|
||||
{
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
ci->botflags.SetFlag(BS_FANTASY);
|
||||
source.Reply(BOT_SET_FANTASY_ON, ci->name.c_str());
|
||||
source.Reply(_("Fantasy mode is now \002\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_FANTASY);
|
||||
source.Reply(BOT_SET_FANTASY_OFF, ci->name.c_str());
|
||||
source.Reply(_("Fantasy mode is now \002\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
SyntaxError(source, "SET FANTASY", BOT_SET_FANTASY_SYNTAX);
|
||||
SyntaxError(source, "SET FANTASY", _("SET \037channel\037 FANTASY {\037ON|\037}"));
|
||||
}
|
||||
else if (option.equals_ci("GREET"))
|
||||
{
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
ci->botflags.SetFlag(BS_GREET);
|
||||
source.Reply(BOT_SET_GREET_ON, ci->name.c_str());
|
||||
source.Reply(_("Greet mode is now \002\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_GREET);
|
||||
source.Reply(BOT_SET_GREET_OFF, ci->name.c_str());
|
||||
source.Reply(_("Greet mode is now \002\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
SyntaxError(source, "SET GREET", BOT_SET_GREET_SYNTAX);
|
||||
SyntaxError(source, "SET GREET", _("SET \037channel\037 GREET {\037ON|\037}"));
|
||||
}
|
||||
else if (u->Account()->HasCommand("botserv/set/nobot") && option.equals_ci("NOBOT"))
|
||||
{
|
||||
@@ -132,30 +132,30 @@ class CommandBSSet : public Command
|
||||
ci->botflags.SetFlag(BS_NOBOT);
|
||||
if (ci->bi)
|
||||
ci->bi->UnAssign(u, ci);
|
||||
source.Reply(BOT_SET_NOBOT_ON, ci->name.c_str());
|
||||
source.Reply(_("No Bot mode is now \002\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_NOBOT);
|
||||
source.Reply(BOT_SET_NOBOT_OFF, ci->name.c_str());
|
||||
source.Reply(_("No Bot mode is now \002\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
SyntaxError(source, "SET NOBOT", BOT_SET_NOBOT_SYNTAX);
|
||||
SyntaxError(source, "SET NOBOT", _("SET \037botname\037 NOBOT {\037ON|\037}"));
|
||||
}
|
||||
else if (option.equals_ci("SYMBIOSIS"))
|
||||
{
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
ci->botflags.SetFlag(BS_SYMBIOSIS);
|
||||
source.Reply(BOT_SET_SYMBIOSIS_ON, ci->name.c_str());
|
||||
source.Reply(_("Symbiosis mode is now \002\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_SYMBIOSIS);
|
||||
source.Reply(BOT_SET_SYMBIOSIS_OFF, ci->name.c_str());
|
||||
source.Reply(_("Symbiosis mode is now \002\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
SyntaxError(source, "SET SYMBIOSIS", BOT_SET_SYMBIOSIS_SYNTAX);
|
||||
SyntaxError(source, "SET SYMBIOSIS", _("SET \037channel\037 SYMBIOSIS {\037ON|\037}"));
|
||||
}
|
||||
else if (option.equals_ci("MSG"))
|
||||
{
|
||||
@@ -164,34 +164,34 @@ class CommandBSSet : public Command
|
||||
ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
|
||||
ci->botflags.UnsetFlag(BS_MSG_NOTICE);
|
||||
ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
|
||||
source.Reply(BOT_SET_MSG_OFF, ci->name.c_str());
|
||||
source.Reply(_("Fantasy replies will no longer be sent to %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("PRIVMSG"))
|
||||
{
|
||||
ci->botflags.SetFlag(BS_MSG_PRIVMSG);
|
||||
ci->botflags.UnsetFlag(BS_MSG_NOTICE);
|
||||
ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
|
||||
source.Reply(BOT_SET_MSG_PRIVMSG, ci->name.c_str());
|
||||
source.Reply(_("Fantasy replies will be sent via PRIVMSG to %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("NOTICE"))
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
|
||||
ci->botflags.SetFlag(BS_MSG_NOTICE);
|
||||
ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
|
||||
source.Reply(BOT_SET_MSG_NOTICE, ci->name.c_str());
|
||||
source.Reply(_("Fantasy replies will be sent via NOTICE to %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("NOTICEOPS"))
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
|
||||
ci->botflags.UnsetFlag(BS_MSG_NOTICE);
|
||||
ci->botflags.SetFlag(BS_MSG_NOTICEOPS);
|
||||
source.Reply(BOT_SET_MSG_NOTICEOPS, ci->name.c_str());
|
||||
source.Reply(_("Fantasy replies will be sent via NOTICE to channel ops on %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
SyntaxError(source, "SET MSG", BOT_SET_MSG_SYNTAX);
|
||||
SyntaxError(source, "SET MSG", _("SET \037channel\037 MSG {\037OFF|PRIVMSG|NOTICE|\037}"));
|
||||
}
|
||||
else
|
||||
source.Reply(BOT_SET_UNKNOWN, option.c_str());
|
||||
source.Reply(LanguageString::UNKNOWN_OPTION, option.c_str(), this->name.c_str());
|
||||
}
|
||||
|
||||
return MOD_CONT;
|
||||
@@ -201,27 +201,90 @@ class CommandBSSet : public Command
|
||||
{
|
||||
if (subcommand.empty())
|
||||
{
|
||||
source.Reply(BOT_HELP_SET);
|
||||
source.Reply(_("Syntax: \002SET \037(channel | bot)\037 \037option\037 \037parameters\037\002\n"
|
||||
" \n"
|
||||
"Configures bot options. \037option\037 can be one of:\n"
|
||||
" \n"
|
||||
" DONTKICKOPS To protect ops against bot kicks\n"
|
||||
" DONTKICKVOICES To protect voices against bot kicks\n"
|
||||
" GREET Enable greet messages\n"
|
||||
" FANTASY Enable fantaisist commands\n"
|
||||
" SYMBIOSIS Allow the bot to act as a real bot\n"
|
||||
" MSG Configure how fantasy commands should be replied to\n"
|
||||
" \n"
|
||||
"Type \002%R%S HELP SET \037option\037\002 for more information\n"
|
||||
"on a specific option.\n"
|
||||
"Note: access to this command is controlled by the\n"
|
||||
"level SET."));
|
||||
User *u = source.u;
|
||||
if (u->Account() && u->Account()->IsServicesOper())
|
||||
source.Reply(BOT_SERVADMIN_HELP_SET);
|
||||
source.Reply(_("These options are reserved to Services Operators:\n"
|
||||
" \n"
|
||||
" NOBOT Prevent a bot from being assigned to \n"
|
||||
" a channel\n"
|
||||
" PRIVATE Prevent a bot from being assigned by\n"
|
||||
" non IRC operators"));
|
||||
}
|
||||
else if (subcommand.equals_ci("DONTKICKOPS"))
|
||||
source.Reply(BOT_HELP_SET_DONTKICKOPS);
|
||||
source.Reply(_("Syntax: \002SET \037channel\037 DONTKICKOPS {\037ON|OFF\037}\n"
|
||||
" \n"
|
||||
"Enables or disables \002ops protection\002 mode on a channel.\n"
|
||||
"When it is enabled, ops won't be kicked by the bot\n"
|
||||
"even if they don't match the NOKICK level."));
|
||||
else if (subcommand.equals_ci("DONTKICKVOICES"))
|
||||
source.Reply(BOT_HELP_SET_DONTKICKVOICES);
|
||||
source.Reply(_("Syntax: \002SET \037channel\037 DONTKICKVOICES {\037ON|OFF\037}\n"
|
||||
" \n"
|
||||
"Enables or disables \002voices protection\002 mode on a channel.\n"
|
||||
"When it is enabled, voices won't be kicked by the bot\n"
|
||||
"even if they don't match the NOKICK level."));
|
||||
else if (subcommand.equals_ci("FANTASY"))
|
||||
source.Reply(BOT_HELP_SET_FANTASY);
|
||||
source.Reply(_("Syntax: \002SET \037channel\037 FANTASY {\037ON|OFF\037}\n"
|
||||
"Enables or disables \002fantasy\002 mode on a channel.\n"
|
||||
"When it is enabled, users will be able to use\n"
|
||||
"commands !op, !deop, !voice, !devoice,\n"
|
||||
"!kick, !kb, !unban, !seen on a channel (find how \n"
|
||||
"to use them; try with or without nick for each, \n"
|
||||
"and with a reason for some?).\n"
|
||||
" \n"
|
||||
"Note that users wanting to use fantaisist\n"
|
||||
"commands MUST have enough level for both\n"
|
||||
"the FANTASIA and another level depending\n"
|
||||
"of the command if required (for example, to use \n"
|
||||
"!op, user must have enough access for the OPDEOP\n"
|
||||
"level)."));
|
||||
else if (subcommand.equals_ci("GREET"))
|
||||
source.Reply(BOT_HELP_SET_GREET);
|
||||
source.Reply(_("Syntax: \002SET \037channel\037 GREET {\037ON|OFF\037}\n"
|
||||
" \n"
|
||||
"Enables or disables \002greet\002 mode on a channel.\n"
|
||||
"When it is enabled, the bot will display greet\n"
|
||||
"messages of users joining the channel, provided\n"
|
||||
"they have enough access to the channel."));
|
||||
else if (subcommand.equals_ci("SYMBIOSIS"))
|
||||
source.Reply(BOT_HELP_SET_SYMBIOSIS, Config->s_ChanServ.c_str());
|
||||
source.Reply(_("Syntax: \002SET \037channel\037 SYMBIOSIS {\037ON|OFF\037}\n"
|
||||
" \n"
|
||||
"Enables or disables \002symbiosis\002 mode on a channel.\n"
|
||||
"When it is enabled, the bot will do everything\n"
|
||||
"normally done by %s on channels, such as MODEs,\n"
|
||||
"KICKs, and even the entry message."), Config->s_ChanServ.c_str());
|
||||
else if (subcommand.equals_ci("NOBOT"))
|
||||
source.Reply(BOT_SERVADMIN_HELP_SET_NOBOT);
|
||||
source.Reply(_("Syntax: \002SET \037channel\037 NOBOT {\037ON|OFF\037}\002\n"
|
||||
" \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."));
|
||||
else if (subcommand.equals_ci("PRIVATE"))
|
||||
source.Reply(BOT_SERVADMIN_HELP_SET_PRIVATE);
|
||||
source.Reply(_("Syntax: \002SET \037bot-nick\037 PRIVATE {\037ON|OFF\037}\002\n"
|
||||
"This option prevents a bot from being assigned to a\n"
|
||||
"channel by users that aren't IRC operators."));
|
||||
else if (subcommand.equals_ci("MSG"))
|
||||
source.Reply(BOT_HELP_SET_MSG);
|
||||
source.Reply(_("Syntax: \002SET \037channel\037 MSG {\037OFF|PRIVMSG|NOTICE|NOTICEOPS\037}\002\n"
|
||||
" \n"
|
||||
"Configures how fantasy commands should be returned to the channel. Off disables\n"
|
||||
"fantasy from replying to the channel. Privmsg, notice, and noticeops message the\n"
|
||||
"channel, notice the channel, and notice the channel ops respectively.\n"
|
||||
" \n"
|
||||
"Note that replies over one line will not use this setting to prevent spam, and will\n"
|
||||
"go directly to the user who executed it."));
|
||||
else
|
||||
return false;
|
||||
|
||||
@@ -230,12 +293,12 @@ class CommandBSSet : public Command
|
||||
|
||||
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
|
||||
{
|
||||
SyntaxError(source, "SET", BOT_SET_SYNTAX);
|
||||
SyntaxError(source, "SET", _("SET \037(channel | bot)\037 \037option\037 \037settings\037"));
|
||||
}
|
||||
|
||||
void OnServHelp(CommandSource &source)
|
||||
{
|
||||
source.Reply(BOT_HELP_CMD_SET);
|
||||
source.Reply(_(" SET Configures bot options"));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user