Add support for bots with halfop/admin/owner perm

This commit is contained in:
Lilian Jónsdóttir 2023-08-21 12:19:47 -07:00
parent 46345aaf15
commit 68c6630552

View file

@ -232,7 +232,12 @@ class CIdleRPGMod : public CModule {
} }
// Bot has op? // Bot has op?
if (!pBot->HasPerm(CChan::Op)) { auto is_op = [](CNick* bot) {
return (bot->HasPerm(CChan::Op) || bot->HasPerm(CChan::HalfOp) ||
bot->HasPerm(CChan::Admin) || bot->HasPerm(CChan::Owner));
};
if (!is_op(pBot)) {
PutModule(t_f( PutModule(t_f(
"Error logging in: Bot [{1}] not operator in in channel [{2}]")( "Error logging in: Bot [{1}] not operator in in channel [{2}]")(
sChan.GetBotnick(), sChan.GetChannel())); sChan.GetBotnick(), sChan.GetChannel()));
@ -284,4 +289,4 @@ void TModInfo<CIdleRPGMod>(CModInfo& Info) {
NETWORKMODULEDEFS( NETWORKMODULEDEFS(
CIdleRPGMod, CIdleRPGMod,
t_s("Automatically handles your login to IdleRPG games/channels")) t_s("Automatically handles your login to IdleRPG games/channels"))