Skip to content

Commit

Permalink
Add ability to set trade offer message
Browse files Browse the repository at this point in the history
  • Loading branch information
dm1tz committed Aug 2, 2024
1 parent 9d2aaca commit 155a1c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ public async Task<bool> JoinGroup(ulong groupID) {
}

[PublicAPI]
public async Task<(bool Success, HashSet<ulong>? TradeOfferIDs, HashSet<ulong>? MobileTradeOfferIDs)> SendTradeOffer(ulong steamID, IReadOnlyCollection<Asset>? itemsToGive = null, IReadOnlyCollection<Asset>? itemsToReceive = null, string? token = null, bool forcedSingleOffer = false, ushort itemsPerTrade = Trading.MaxItemsPerTrade) {
public async Task<(bool Success, HashSet<ulong>? TradeOfferIDs, HashSet<ulong>? MobileTradeOfferIDs)> SendTradeOffer(ulong steamID, IReadOnlyCollection<Asset>? itemsToGive = null, IReadOnlyCollection<Asset>? itemsToReceive = null, string? token = null, bool forcedSingleOffer = false, string? message = null, ushort itemsPerTrade = Trading.MaxItemsPerTrade) {
if ((steamID == 0) || !new SteamID(steamID).IsIndividualAccount) {
throw new ArgumentOutOfRangeException(nameof(steamID));
}
Expand Down Expand Up @@ -628,7 +628,7 @@ public async Task<bool> JoinGroup(ulong groupID) {
{ "partner", steamID.ToString(CultureInfo.InvariantCulture) },
{ "serverid", "1" },
{ "trade_offer_create_params", !string.IsNullOrEmpty(token) ? new JsonObject { { "trade_offer_access_token", token } }.ToJsonText() : "" },
{ "tradeoffermessage", $"Sent by {SharedInfo.PublicIdentifier}/{SharedInfo.Version}" }
{ "tradeoffermessage", !string.IsNullOrEmpty(message) ? message : $"Sent by {SharedInfo.PublicIdentifier}/{SharedInfo.Version}" }
};

HashSet<ulong> tradeOfferIDs = new(trades.Count);
Expand Down

0 comments on commit 155a1c1

Please sign in to comment.