public async Task <bool> RemoveQueue(IUser user, string queueName, string guildId)
        {
            var queue = await _client.GetItem(guildId, queueName.ToLowerInvariant());

            var result = false;

            if (queue?.OwnerId == user.Id.ToString())
            {
                result = await _client.Delete(queue);
            }
            return(result);
        }
예제 #2
0
        public async Task <Blog> GetBlogInfo()
        {
            var blog = await azureTableStorage.GetItem("blogs", "primary");

            if (blog != null)
            {
                return(blog);
            }
            blog = InitBlogInfo();
            await SaveBlogInfo(blog);

            return(blog);
        }
예제 #3
0
        public async Task <Note> GetRecordAsync(string id)
        {
            var o = await _repository.GetItem(PartitionKey, id);

            if (o == null)
            {
                return(null);
            }

            return(DeserializingNote(o));
        }
예제 #4
0
 public async Task <DuelChallenge> Find(IGuildUser challenger, IGuildUser challengee)
 {
     return(await _client.GetItem(challenger.GuildId.ToString(), $"{challenger.Id}||{challengee.Id}"));
 }
예제 #5
0
 public async Task <Post> GetById(string id, string partitionKey = "")
 {
     return(await azureTableStorage.GetItem(partitionKey, id));
 }
예제 #6
0
 public async Task <DuelPlayer> Find(IGuildUser user)
 {
     return(await _client.GetItem(user.GuildId.ToString(), user.Id.ToString()));
 }
        public async Task <SubscriberActivities> Find(IGuildUser user)
        {
            var result = await _client.GetItem(user.GuildId.ToString(), user.Id.ToString());

            return(result ?? new SubscriberActivities(user));
        }
예제 #8
0
 public async Task <Server> Find(ulong guildId, string host)
 {
     return(await _client.GetItem(guildId.ToString(), host.ToLowerInvariant()));
 }
예제 #9
0
        public async Task <FlaggedSubscriber> IsFlagged(IGuildUser user)
        {
            var subscriber = await _client.GetItem(user.GuildId.ToString(), user.Id.ToString());

            return(subscriber);
        }
예제 #10
0
 public async Task <ProductInfo> GetDetailsAsync(string userId, long id)
 {
     return(await _repository.GetItem(userId, id.ToString()));
 }
예제 #11
0
 public async Task <ProductInfoHistory> GetDetailsAsync(long productId, long id)
 {
     return(await _repository.GetItem(productId, id));
 }
 public async Task <PickupQueue> FindQueue(string queueName, string guildId)
 {
     return(await _client.GetItem(guildId, queueName.ToLowerInvariant()));
 }