public async Task <object> GetGuildSettings(string key, ulong id, ulong userId) { if (!Token.Authorize(key, false)) { return new ApiResponse { Status = 401, Message = "Not authorized: Invalid API key." } } ; try { var gld = await Client.DiscordClient.GetGuildAsync(id); var dummy = await gld.GetMemberAsync(userId); } catch { return(new ApiResponse { Status = 404, Message = "Not found: Neither the guild or the user have been found." }); } var data = new GuildSettings(id, userId); try { data.Settings = DataManager.GetData <GuildData>(id); } catch { return(new ApiResponse { Status = 404, Message = "Not found: Configuration file has not been found." }); } await data.GetRolesAndChannels(); return(data); } }