Example #1
0
        public async Task AddNHentaiSubscription(ITextChannel chan, Subscription.SubscriptionTags tags)
        {
            string guildIdStr   = chan.GuildId.ToString();
            string channelIdStr = chan.Id.ToString();
            await R.Db(dbName).Table("Guilds").Update(R.HashMap("id", guildIdStr)
                                                      .With("nhentaiSubscription", channelIdStr)
                                                      .With("nhentaiSubscriptionTags", tags.ToStringArray())
                                                      ).RunAsync(conn);

            NHentaiSubscription.Add((chan, tags));
        }
Example #2
0
        public async Task AddNHentaiSubscription(ITextChannel chan, Subscription.SubscriptionTags tags)
        {
            string guildIdStr   = chan.GuildId.ToString();
            string channelIdStr = chan.Id.ToString();
            await R.Db(dbName).Table("Guilds").Update(R.HashMap("id", guildIdStr)
                                                      .With("nhentaiSubscription", channelIdStr)
                                                      .With("nhentaiSubscriptionTags", tags.ToStringArray())
                                                      ).RunAsync(conn);

            if (NHentaiSubscription.Any(x => x.Item1.Id == chan.Id))
            {
                NHentaiSubscription.Remove(NHentaiSubscription.Where(x => x.Item1.Id == chan.Id).ElementAt(0));
            }
            NHentaiSubscription.Add((chan, tags));
        }