예제 #1
0
        public async Task CheckForLeavers(CommandContext ctx, string clanTag)
        {
            var roles        = ctx.Member.Roles.ToList();
            var verification = await IsVerifiedAsync(ctx, true);

            var clan = await GetClanFromTagOrNameAsync(ctx, clanTag);

            clanTag = clanTag.ToLower();

            if (clan != null && verification == ErrorCode.Qualify && !string.IsNullOrEmpty(clan.details.Tag))
            {
                var            discordEmbed = Core.Discord.CreateFancyMessage(DiscordColor.Turquoise, "Checking for leavers...");
                DiscordMessage msg          = await ctx.RespondAsync(discordEmbed);

                var leavers = await BungieTools.CheckForLeaves(clan, true);

                if (leavers.Count > 0)
                {
                    await msg.DeleteAsync();

                    var fields = new List <Field>();
                    Core.Discord.SendFancyListMessage(ctx.Channel, clan, leavers, "Users found leaving " + clan.details.Name + ":");
                }
                else
                {
                    discordEmbed = Core.Discord.CreateFancyMessage(DiscordColor.SpringGreen, "No leavers found", "No one to remove from sheet <:unipeepo:601277029459034112>");
                    await msg.ModifyAsync(discordEmbed);
                }
                await ThankUsage(ctx, clan, 100);
            }
        }
예제 #2
0
        public static async Task CheckForLeavers(Clan clan)
        {
            Log.Information("Checking for leavers for " + clan.details.Name);
            var Leavers = await BungieTools.CheckForLeaves(clan);

            foreach (var channel in Core.Discord.alertsChannels)
            {
                Core.Discord.SendFancyListMessage(channel, clan, Leavers, "Users found leaving " + clan.details.Name + ":");
            }
            //Core.Discord.alertsChannels.ForEach(async channel =>
            //{
            //    Core.Discord.SendFancyListMessage(channel, clan, Leavers, "Users found leaving " + clan.details.BungieNetName + ":");
            //});
            //Core.Discord.SendFancyListMessage(Core.Discord.alertsChannel ,clan, Leavers, "Users found leaving " + clan.details.BungieNetName + ":");
        }