diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index f8dbc9a8246fa..6cca3df03154d 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -1170,12 +1170,12 @@ private void HandleCallbacks() { } } - private async Task HandleMessage(ulong steamID, string message) { - if (steamID == 0 || string.IsNullOrEmpty(message)) { + private async Task HandleMessage(ulong chatID, ulong steamID, string message) { + if (chatID == 0 || steamID == 0 || string.IsNullOrEmpty(message)) { return; } - SendMessage(steamID, await Response(steamID, message).ConfigureAwait(false)); + SendMessage(chatID, await Response(steamID, message).ConfigureAwait(false)); } private void SendMessage(ulong steamID, string message) { @@ -1409,7 +1409,7 @@ private async void OnChatMsg(SteamFriends.ChatMsgCallback callback) { SteamFriends.LeaveChat(callback.ChatRoomID); break; default: - await HandleMessage(callback.ChatRoomID, callback.Message).ConfigureAwait(false); + await HandleMessage(callback.ChatRoomID, callback.ChatterID, callback.Message).ConfigureAwait(false); break; } } @@ -1447,7 +1447,7 @@ private async void OnFriendMsg(SteamFriends.FriendMsgCallback callback) { return; } - await HandleMessage(callback.Sender, callback.Message).ConfigureAwait(false); + await HandleMessage(callback.Sender, callback.Sender, callback.Message).ConfigureAwait(false); } private async void OnFriendMsgHistory(SteamFriends.FriendMsgHistoryCallback callback) { @@ -1481,7 +1481,7 @@ private async void OnFriendMsgHistory(SteamFriends.FriendMsgHistoryCallback call } // Handle the message - await HandleMessage(callback.SteamID, lastMessage.Message).ConfigureAwait(false); + await HandleMessage(callback.SteamID, callback.SteamID, lastMessage.Message).ConfigureAwait(false); } private void OnAccountInfo(SteamUser.AccountInfoCallback callback) { diff --git a/ArchiSteamFarm/WebBrowser.cs b/ArchiSteamFarm/WebBrowser.cs index 6e613e29fc53e..6e5ecdda74099 100644 --- a/ArchiSteamFarm/WebBrowser.cs +++ b/ArchiSteamFarm/WebBrowser.cs @@ -42,7 +42,7 @@ internal static class WebBrowser { private static readonly string DefaultUserAgent = "ArchiSteamFarm/" + Program.Version; private static readonly HttpClient HttpClient = new HttpClient(new HttpClientHandler { - UseCookies = false + UseCookies = false, }) { Timeout = TimeSpan.FromSeconds(60) };