Skip to content

Commit

Permalink
feat: 顯示直播 Id 並忽略空的直播 Id
Browse files Browse the repository at this point in the history
  • Loading branch information
konnokai committed May 31, 2024
1 parent e3b9072 commit 0301c53
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ private async Task TimerHandel()

foreach (var stream in streams)
{
if (string.IsNullOrEmpty(stream.Id))
continue;

if (hashSet.Contains(stream.Id))
continue;

Expand Down Expand Up @@ -246,12 +249,12 @@ private async Task TimerHandel()
private async Task SendStreamMessageAsync(TwitchStream twitchStream, TwitchSpider twitchSpider, bool isRecord = false)
{
#if DEBUG || DEBUG_DONTREGISTERCOMMAND
Log.New($"Twitch 開台通知: {twitchStream.UserName} - {twitchStream.StreamTitle}");
Log.New($"Twitch 開台通知: {twitchStream.UserName} - {twitchStream.StreamTitle} ({twitchStream})");
#else
using (var db = MainDbContext.GetDbContext())
{
var noticeGuildList = db.NoticeTwitchStreamChannels.Where((x) => x.NoticeTwitchUserId == twitchStream.UserId).ToList();
Log.New($"發送 Twitch 開台通知 ({noticeGuildList.Count}): {twitchStream.UserName} - {twitchStream.StreamTitle}");
Log.New($"發送 Twitch 開台通知 ({noticeGuildList.Count}): {twitchStream.UserName} - {twitchStream.StreamTitle} ({twitchStream})");

EmbedBuilder embedBuilder = new EmbedBuilder()
.WithTitle(twitchStream.StreamTitle)
Expand Down

0 comments on commit 0301c53

Please sign in to comment.