Ejemplo n.º 1
0
        /// <summary>
        /// Handles the specified direct message command
        /// Sourced from Command.cs of OxideMod (https://github.com/OxideMod/Oxide.Rust/blob/develop/src/Libraries/Command.cs#L361)
        /// </summary>
        /// <param name="client"></param>
        /// <param name="channel"></param>
        /// <param name="name"></param>
        /// <param name="args"></param>
        /// <param name="message"></param>
        internal bool HandleGuildCommand(BotClient client, DiscordMessage message, DiscordChannel channel, string name, string[] args)
        {
            GuildCommand command = _guildCommands[name];

            if (command == null || !command.CanRun(client) || !command.CanHandle(message, channel))
            {
                return(false);
            }

            if (!command.Plugin.IsLoaded)
            {
                _guildCommands.Remove(name);
                return(false);
            }

            if (!client.IsPluginRegistered(command.Plugin))
            {
                return(false);
            }

            command.HandleCommand(message, name, args);
            return(true);
        }