private async Task UpdateState(CommandContext ctx, AlertType alertType, bool isSubscribed) { var userSubs = await _userSubsService.GetOrCreate(ctx.Member.Id, ctx.Guild.Id).ConfigureAwait(false); switch (alertType) { case AlertType.Works: userSubs.Works = isSubscribed; break; case AlertType.Adventure: userSubs.Adventure = isSubscribed; break; case AlertType.Training: userSubs.Training = isSubscribed; break; } await _userSubsService.Update(userSubs).ConfigureAwait(false); }
public async Task <bool> IsSubscribed(CommandContext ctx, AlertType alertType) { var userSubs = await _userSubsService.GetOrCreate(ctx.Member.Id, ctx.Guild.Id).ConfigureAwait(false); switch (alertType) { case AlertType.Works: return(userSubs.Works); case AlertType.Adventure: return(userSubs.Adventure); case AlertType.Training: return(userSubs.Training); default: return(false); } }