Skip to content

Commit

Permalink
fix keep open
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed May 10, 2024
1 parent 94bf403 commit 3d4030d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ public static async Task Main(string[] args)

User me = await botClient.GetMeAsync(cancellationToken: cts.Token);

Console.WriteLine($"Start listening for @{me.Username}. Stop with keypress..");
Console.ReadLine();
Console.WriteLine($"Start listening for @{me.Username}.");

// Bot is in threads - sleep main thread
while (true)
{
Thread.Sleep(Timeout.Infinite);
}

// Send cancellation request to stop bot
await cts.CancelAsync();
Expand Down

0 comments on commit 3d4030d

Please sign in to comment.