Added signed up options for role reminder

Added option to opt out of reminders
This commit is contained in:
Sarah Faey 2022-12-09 22:26:16 +01:00
parent 64ce169094
commit c88bf5b133
18 changed files with 911 additions and 99 deletions

View file

@ -242,5 +242,20 @@ namespace DiscordBot.Services
}
return new Tuple<bool, string>(true, string.Empty);
}
public async Task<bool> ReminderOptOut(ulong userId)
{
var httpClient = _httpClientFactory.CreateClient(Constants.HTTP_CLIENT_NAME);
var httpResponseMessage = await httpClient.GetAsync($"DiscordBot/ReminderOptOut/{userId}");
if (httpResponseMessage.IsSuccessStatusCode)
{
using var contentStream =
await httpResponseMessage.Content.ReadAsStreamAsync();
return await JsonSerializer.DeserializeAsync<bool>(contentStream, _serializerOptions);
}
return false;
}
}
}