Include topup link

This commit is contained in:
2023-11-14 14:20:19 +00:00
parent b93fa4bc0f
commit 3a9a8dc1e7

View File

@ -82,7 +82,8 @@ public class NostrStreamManager : IStreamManager
if (_context.User.Balance >= balanceAlertThreshold && _context.User.Balance - cost < balanceAlertThreshold)
{
var chat = _eventBuilder.CreateStreamChat(_context.UserStream,
$"Your balance is below {(int)(balanceAlertThreshold / 1000m)} sats, please topup");
$"Your balance is below {(int)(balanceAlertThreshold / 1000m)} sats, please topup, " +
$"or use this link: lnurlp://zap.stream/.well-known/lnurlp/${_context.User.PubKey}");
_eventBuilder.BroadcastEvent(chat);
}
@ -128,7 +129,7 @@ public class NostrStreamManager : IStreamManager
Duration = result.Duration,
Timestamp = DateTime.UtcNow //DateTimeOffset.FromUnixTimeMilliseconds(long.Parse(matches.Groups[1].Value)).UtcDateTime
});
await _context.Db.SaveChangesAsync();
}