Exemple #1
0
        public async Task UnblockChannel()
        {
            var guildUser = Context.User as SocketGuildUser;

            if (!guildUser.GuildPermissions.ManageChannels)
            {
                string description =
                    $"{Global.ENo} **|** You Need the **Manage Channels** Permission to do that {Context.User.Username}";
                var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description,
                                                          EmbedHandler.EmbedMessageType.Exception);
                await ReplyAndDeleteAsync("", embed : errorEmbed);

                return;
            }

            var config = BotAccounts.GetAccount();

            config.BlockedChannels.Remove(Context.Channel.Id);
            BotAccounts.SaveAccounts();

            var embed = MiscHelpers
                        .CreateEmbed(Context, "Channel Unblocked", $":unlock: Unblocked {Context.Channel.Name}.")
                        .WithColor(Constants.DefaultColor);

            await SendMessage(Context, embed.Build());
        }
Exemple #2
0
        public async Task AutoLewdIMG(string arg)
        {
            var guildAcc = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id);
            var botAcc   = BotAccounts.GetAccount();
            var result   = ConvertBool.ConvertStringToBoolean(arg);

            if (!result.Item1)
            {
                await SendMessage(Context, null, $"Please say `n!autolewd <on/off>`");
            }

            else if (result.Item2)
            {
                await SendMessage(Context, null, $"Started the AutoLewd loop :3");

                guildAcc.AutoLewdStatus = Enabled;
                botAcc.AutoLewdGuilds.Add(guildAcc.Id);
                GlobalGuildAccounts.SaveAccounts(Context.Guild.Id);
                BotAccounts.SaveAccounts();
            }

            else if (!result.Item2)
            {
                guildAcc.AutoLewdStatus = Disabled;
                botAcc.AutoLewdGuilds.Remove(guildAcc.Id);
                GlobalGuildAccounts.SaveAccounts(Context.Guild.Id);
                BotAccounts.SaveAccounts();
                await SendMessage(Context, null, $"Stopped the AutoLewd loop :/");
            }
        }