forked from Sarah/Lieb-Website
Added signed up options for role reminder
Added option to opt out of reminders
This commit is contained in:
parent
64ce169094
commit
c88bf5b133
18 changed files with 911 additions and 99 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue