List randoms at the end of trade requests

This commit is contained in:
mez 2025-08-02 19:55:16 +01:00
parent b946ad3dda
commit 696a1bfbbd

View file

@ -1456,6 +1456,14 @@ def maketrade():
thein = sorted(inc + ins)
theout = sorted(outc + outs)
if randoms:
realwant = []
fakewant = []
for card in theout:
if card in theirwantlist:
realwant.append(card)
else:
fakewant.append(card)
theout = realwant + fakewant
randomstotal = totalrandomch + totalrandomsp
addsigs = input("Add signatures? [y/N] ")
if addsigs == "y":
@ -1465,7 +1473,7 @@ def maketrade():
tradestring = "\nmy " + ", ".join(theout) + "\n\nfor your " + ", ".join(thein) + "?"
if randoms:
if randomstotal > 0:
tradestring += "\n\n(" + str(len(thein)) + " cards, including " + str(randomstotal) + " randoms)"
tradestring += "\n\n(" + str(len(thein)) + " cards, including " + str(randomstotal) + " randoms [end of list])"
elif len(thein) > 19:
tradestring += "\n\n(" + str(len(thein)) + " cards)"
tradestring += "\n\n<img src=\"https://colors-tcg.eu/cards/" + ".gif\"><img src=\"https://colors-tcg.eu/cards/".join(theout) + ".gif\">"