public static ModuleDetails ResolveModule(this DiscordBotService service, ModuleInfo mod) { return(service.ResolveModule(mod.GetDetailsName())); }
public static CommandDetails ResolveCommand(this DiscordBotService service, CommandInfo cmd) { return(service.ResolveCommand(cmd.GetDetailsName())); }
public static ModuleDetails ResolveModule(this DiscordBotService service, string moduleName) { return(service.Commands.CommandSet.FindModule(moduleName)); }
/*/// <summary> * /// Gets if the specified command or its module is locked. * /// </summary> * /// <param name="lockContext">The lockable context to work with.</param> * /// <param name="command">The command to check.</param> * /// <returns>True if the command or its module is locked.</returns> * public static bool IsLocked(this IDbLockableContext lockContext, CommandDetails command) { * if (lockContext == null) * return command.IsLockedByDefault || command.Module.IsLockedByDefault; * return (lockContext.IsCommandLocked(command) || lockContext.IsModuleLocked(command.Module)); * } * /// <summary> * /// Gets if the specified command is locked. * /// </summary> * /// <param name="lockContext">The lockable context to work with.</param> * /// <param name="command">The command to check.</param> * /// <returns>True if the command is locked.</returns> * public static bool IsCommandLocked(this IDbLockableContext lockContext, CommandDetails command) { * if (lockContext == null) * return command.IsLockedByDefault; * return (command.IsLockable && command.IsLockedByDefault != * lockContext.LockedCommands.Contains(command.Alias)); * } * /// <summary> * /// Gets if the specified module is locked. * /// </summary> * /// <param name="lockContext">The lockable context to work with.</param> * /// <param name="module">The module to check.</param> * /// <returns>True if the module is locked.</returns> * public static bool IsModuleLocked(this IDbLockableContext lockContext, ModuleDetails module) { * if (lockContext == null) * return module.IsLockedByDefault; * return (module.IsLockable && module.IsLockedByDefault != * lockContext.LockedModules.Contains(module.Name)); * }*/ public static CommandDetails ResolveCommand(this DiscordBotService service, string commandName) { return(service.Commands.CommandSet.FindCommand(commandName)); }