Ejemplo n.º 1
0
        public override async Task <bool> Evaluate(AbbybotCommandArgs aca)
        {
            var abbybots = await AbbybotSql.GetAbbybotIdAsync();

            bool e = false;

            foreach (var abbybot in abbybots)
            {
                if (aca.user.Id == abbybot)
                {
                    e = true;
                }
            }

            bool listenChannel   = false;
            var  abbybotchannels = await AbbybotSql.GetAbbybotChannelIdAsync();

            foreach (var abbybotchannel in abbybotchannels)
            {
                if (aca.channel.Id == abbybotchannel.channelId)
                {
                    listenChannel = true;
                }
            }

            return(e && listenChannel && await Eval(aca));
        }
Ejemplo n.º 2
0
        public static async Task <bool> IsAbbybotHere(ulong guildId)
        {
            var abbybotids = await AbbybotSql.GetAbbybotIdAsync();

            abbybotids.Remove(Apis.Discord.__client.CurrentUser.Id);
            bool b = false;

            foreach (var o in abbybotids)
            {
                var u = Apis.Discord.__client.GetUser(o);
                b = u.MutualGuilds.ToList().Any(x => x.Id == guildId);
            }
            return(b);
        }