Skip to content

Commit cc773e6

Browse files
committed
Merge branch 'release/v1.2.3'
2 parents 57d25dd + a6dfba9 commit cc773e6

File tree

1 file changed

+3
-2
lines changed
  • Wissance.MossbauerLab.Watcher/Wissance.MossbauerLab.Watcher.Services/Notification

1 file changed

+3
-2
lines changed

Wissance.MossbauerLab.Watcher/Wissance.MossbauerLab.Watcher.Services/Notification/TelegramNotifier.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async Task<bool> NotifySpectrumSavedAsync(IList<SpectrumReadyData> spectr
3434
try
3535
{
3636
ITelegramBotClient client = new TelegramBotClient(_tgRequisites.BotKey);
37-
ChatId targetChatId = GetChatId(_tgRequisites);
37+
ChatId targetChatId = GetChatId();
3838
Message msg = CreateMessageFromTemplate(spectra);
3939
username = targetChatId.Username;
4040
await client.SendTextMessageAsync(targetChatId, msg.Text);
@@ -66,8 +66,9 @@ private Message CreateMessageFromTemplate(IList<SpectrumReadyData> spectra)
6666
return msg;
6767
}
6868

69-
private ChatId GetChatId(TelegramSendRequisites _tgRequisites)
69+
private ChatId GetChatId()
7070
{
71+
// This is tutorial about where to get chatId : https://gist.github.com/nafiesl/4ad622f344cd1dc3bb1ecbe468ff9f8a
7172
if (_tgRequisites.GroupId.HasValue)
7273
return new ChatId(_tgRequisites.GroupId.Value);
7374
return new ChatId(_tgRequisites.GroupName);

0 commit comments

Comments
 (0)