Exemple #1
0
        public async Task RemoveBot(params string[] args)
        {
            if (!(args.Length == 2))
            {
                await ReplyAsync("Please use the right number of arguments.");

                return;
            }

            if (ulong.TryParse(args[0], out ulong id))
            {
                Submission toRemove;
                GuildData  guildData = data.GetGuild(Context.Guild.Id);
                if (guildData != null)
                {
                    if (args[1] == "archives")
                    {
                        toRemove = guildData.GetSubmissionFromArchives(id);
                        if (toRemove != null)
                        {
                            guildData.archive.Remove(toRemove);
                            StoreData(id);
                            await ReplyAsync("Successfully removed submission from the archives list.");
                        }
                        else
                        {
                            await ReplyAsync("Could not find bot in archives list.");
                        }
                    }
                    else if (args[1] == "pending")
                    {
                        toRemove = guildData.GetSubmissionFromQueue(id);
                        if (toRemove != null)
                        {
                            guildData.queue.Remove(toRemove);
                            StoreData(id);
                            await ReplyAsync("Successfully removed submission from the pending list.");
                        }
                        else
                        {
                            await ReplyAsync("Could not find bot in pending list.");
                        }
                    }
                    else
                    {
                        await ReplyAsync("Please specify either archives or pending lists.");
                    }
                }
                else
                {
                    await ReplyAsync("Error getting guild data.");
                }
            }
            else
            {
                await ReplyAsync("Please type a valid bot id.");
            }
        }
Exemple #2
0
        async Task ArchiveSubmission(ulong id)
        {
            GuildData guildData = data.GetGuild(Context.Guild.Id);

            if (guildData != null)
            {
                Submission submission = guildData.GetSubmissionFromQueue(id);
                if (submission != null)
                {
                    guildData.archive.Add(submission);
                    guildData.queue.Remove(submission);
                    StoreData(id);
                    await Context.Channel.SendMessageAsync("Submission successfully archived.");
                }
                else
                {
                    await Context.Channel.SendMessageAsync("Could not find the given id in the pending list.");
                }
            }
            else
            {
                await ReplyAsync("Error: Guild data not found.");
            }
        }
Exemple #3
0
        async Task ArchiveSubmission(ulong id)
        {
            GuildData guildData = data.GetGuild(Context.Guild.Id);

            if (guildData != null)
            {
                Submission submission = guildData.GetSubmissionFromQueue(id);
                if (submission != null)
                {
                    guildData.archive.Add(submission);
                    guildData.queue.Remove(submission);
                    StoreData(id);
                    await Context.Channel.SendMessageAsync("Zrobione!");
                }
                else
                {
                    await Context.Channel.SendMessageAsync("Nie znalazłem tego ID w mojej liście.");
                }
            }
            else
            {
                await ReplyAsync("BŁĄD: Nie znalazłem danych serwera.");
            }
        }