diff --git a/include/commands.h b/include/commands.h index d9f15296a..d7d936d74 100644 --- a/include/commands.h +++ b/include/commands.h @@ -34,8 +34,10 @@ struct CommandInfo final Anope::string group; /* whether or not to hide this command in help output */ bool hide = false; - /* Only used with fantasy */ + /* Whether to prepend the channel name (only used with fantasy) */ bool prepend_channel = false; + /* Whether to require the FANTASY privilege (only used with fantasy) */ + bool require_privilege = true; }; /* Where the replies from commands go to. User inherits from this and is the normal diff --git a/modules/fantasy.cpp b/modules/fantasy.cpp index 21a5027d5..2dd28d244 100644 --- a/modules/fantasy.cpp +++ b/modules/fantasy.cpp @@ -188,7 +188,7 @@ public: source.permission = info.permission; AccessGroup ag = c->ci->AccessFor(u); - bool has_fantasy = ag.HasPriv("FANTASY") || source.HasPriv("botserv/fantasy"); + bool has_fantasy = !info.require_privilege || ag.HasPriv("FANTASY") || source.HasPriv("botserv/fantasy"); EventReturn MOD_RESULT; if (has_fantasy) diff --git a/src/config.cpp b/src/config.cpp index b56af4f97..96e005efa 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -491,8 +491,6 @@ Conf::Conf() : Block("") &service = fantasy.Get("command"), &permission = fantasy.Get("permission"), &group = fantasy.Get("group"); - bool hide = fantasy.Get("hide"), - prepend_channel = fantasy.Get("prepend_channel", "yes"); ValidateNotEmpty("fantasy", "name", nname); ValidateNotEmptyOrSpaces("fantasy", "command", service); @@ -501,8 +499,9 @@ Conf::Conf() : Block("") c.name = service; c.permission = permission; c.group = group; - c.hide = hide; - c.prepend_channel = prepend_channel; + c.hide = fantasy.Get("hide"); + c.prepend_channel = fantasy.Get("prepend_channel", "yes"); + c.require_privilege = fantasy.Get("require_privilege", "no"); } for (int i = 0; i < this->CountBlock("command_group"); ++i)