mirror of
https://github.com/anope/anope.git
synced 2026-06-30 09:56:38 +02:00
Added Italics support to the BotSev kickers
This commit is contained in:
@@ -157,7 +157,16 @@ class CommandBSInfo : public Command
|
||||
}
|
||||
else
|
||||
notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, getstring(u, BOT_INFO_INACTIVE));
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_ITALICS))
|
||||
{
|
||||
if (ci->ttb[TTB_ITALICS])
|
||||
notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_ITALICS]);
|
||||
else
|
||||
notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_ACTIVE));
|
||||
}
|
||||
else
|
||||
notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_INACTIVE));
|
||||
|
||||
end = buf;
|
||||
*end = 0;
|
||||
if (ci->botflags.HasFlag(BS_DONTKICKOPS))
|
||||
|
||||
@@ -331,6 +331,36 @@ class CommandBSKick : public Command
|
||||
notice_lang(Config.s_BotServ, u, BOT_KICK_UNDERLINES_OFF);
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("ITALICS"))
|
||||
{
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
if (!ttb.empty())
|
||||
{
|
||||
Anope::string error;
|
||||
ci->ttb[TTB_ITALICS] = convertTo<int16>(ttb, error, false);
|
||||
if (!error.empty() || ci->ttb[TTB_ITALICS] < 0)
|
||||
{
|
||||
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS];
|
||||
ci->ttb[TTB_ITALICS] = 0;
|
||||
notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
else
|
||||
ci->ttb[TTB_ITALICS] = 0;
|
||||
ci->botflags.SetFlag(BS_KICK_ITALICS);
|
||||
if (ci->ttb[TTB_ITALICS])
|
||||
notice_lang(Config.s_BotServ, u, BOT_KICK_ITALICS_ON_BAN, ci->ttb[TTB_ITALICS]);
|
||||
else
|
||||
notice_lang(Config.s_BotServ, u, BOT_KICK_ITALICS_ON);
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_ITALICS);
|
||||
notice_lang(Config.s_BotServ, u, BOT_KICK_ITALICS_OFF);
|
||||
}
|
||||
}
|
||||
else
|
||||
notice_help(Config.s_BotServ, u, BOT_KICK_UNKNOWN, option.c_str());
|
||||
}
|
||||
@@ -357,6 +387,8 @@ class CommandBSKick : public Command
|
||||
notice_help(Config.s_BotServ, u, BOT_HELP_KICK_REVERSES);
|
||||
else if (subcommand.equals_ci("UNDERLINES"))
|
||||
notice_help(Config.s_BotServ, u, BOT_HELP_KICK_UNDERLINES);
|
||||
else if (subcommand.equals_ci("ITALICS"))
|
||||
notice_help(Config.s_BotServ, u, BOT_HELP_KICK_ITALICS);
|
||||
else
|
||||
return false;
|
||||
|
||||
|
||||
@@ -329,6 +329,7 @@ BotFlagInfo BotFlags[] = {
|
||||
{"KICK_CAPS", BS_KICK_CAPS},
|
||||
{"KICK_FLOOD", BS_KICK_FLOOD},
|
||||
{"KICK_REPEAT", BS_KICK_REPEAT},
|
||||
{"KICK_ITALICS", BS_KICK_ITALICS},
|
||||
{"", static_cast<BotServFlag>(-1)}
|
||||
};
|
||||
|
||||
@@ -830,6 +831,8 @@ class DBPlain : public Module
|
||||
ci->ttb[6] = params[j + 1].is_number_only() ? convertTo<int16>(params[j + 1]) : 0;
|
||||
else if (params[j].equals_ci("REPEAT"))
|
||||
ci->ttb[7] = params[j + 1].is_number_only() ? convertTo<int16>(params[j + 1]) : 0;
|
||||
else if (params[j].equals_ci("ITALICS"))
|
||||
ci->ttb[8] = params[j + 1].is_number_only() ? convertTo<int16>(params[j + 1]) : 0;
|
||||
}
|
||||
}
|
||||
else if (params[0].equals_ci("CAPSMIN"))
|
||||
@@ -1078,7 +1081,7 @@ class DBPlain : public Module
|
||||
db << " " << BotFlags[j].Name;
|
||||
db << endl;
|
||||
}
|
||||
db << "MD BI TTB BOLDS " << ci->ttb[0] << " COLORS " << ci->ttb[1] << " REVERSES " << ci->ttb[2] << " UNDERLINES " << ci->ttb[3] << " BADWORDS " << ci->ttb[4] << " CAPS " << ci->ttb[5] << " FLOOD " << ci->ttb[6] << " REPEAT " << ci->ttb[7] << endl;
|
||||
db << "MD BI TTB BOLDS " << ci->ttb[0] << " COLORS " << ci->ttb[1] << " REVERSES " << ci->ttb[2] << " UNDERLINES " << ci->ttb[3] << " BADWORDS " << ci->ttb[4] << " CAPS " << ci->ttb[5] << " FLOOD " << ci->ttb[6] << " REPEAT " << ci->ttb[7] << " ITALICS " << ci->ttb[8] << endl;
|
||||
if (ci->capsmin)
|
||||
db << "MD BI CAPSMIN " << ci->capsmin << endl;
|
||||
if (ci->capspercent)
|
||||
|
||||
@@ -63,6 +63,7 @@ BotFlagInfo BotFlags[] = {
|
||||
{"KICK_CAPS", BS_KICK_CAPS},
|
||||
{"KICK_FLOOD", BS_KICK_FLOOD},
|
||||
{"KICK_REPEAT", BS_KICK_REPEAT},
|
||||
{"KICK_ITALICS", BS_KICK_ITALICS},
|
||||
{"", static_cast<BotServFlag>(-1)}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user