Example #1
0
        public async Task ComandoPrefixoAb(CommandContext ctx, string prefix = null)
        {
            ServidorCore server = ModuloBanco.GetServidor(ctx.Guild.Id);

            if (string.IsNullOrWhiteSpace(prefix))
            {
                server.Prefix = "";
                server.Salvar();
                await ctx.RespondAsync("Prefix removido!").ConfigureAwait(false);
            }
            else
            {
                if (prefix.Length > 3)
                {
                    await ctx.RespondAsync("O prefixo não pode passar de 3 caracteres!").ConfigureAwait(false);

                    return;
                }
                server.Prefix = prefix;
                server.Salvar();
                await ctx.RespondAsync("Prefixo alterado!").ConfigureAwait(false);
            }
        }