Skip to content

Commit

Permalink
Fix group chat commands, #165
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Mar 18, 2016
1 parent bc223f0 commit 79a700d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions ArchiSteamFarm/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion ArchiSteamFarm/WebBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down

0 comments on commit 79a700d

Please sign in to comment.