Having Issues with (trades_only) transactions
Sport
Football
Summary
Hi, I'm trying to write a method to only return the most recent trade, but when trying to use the trades_only arg like in the documentation it's failing.
Thanks a lot love the wrapper!
Logs/Data
if "!trade" in message.content:
activitys = league.recent_activity(1, trades_only=True)
for activity in activitys:
for action in activity.actions:
await message.channel.send(action)
Error Log:
Ignoring exception in on_message Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event await coro(*args, **kwargs) File "main.py", line 71, in on_message activitys = league.recent_activity(1, trades_only=True) TypeError: recent_activity() got an unexpected keyword argument 'trades_only'
Hi @tburge260, sorry for late reply it has been a busy week. recent_activity does not have a trades_only flag. If you want to get only trades it should look like this
activitys = league.recent_activity(1, msg_type='TRADED')
You can find the League functions documented here.
I now see the example on the main Football documentation page that is wrong. Sorry about that! Will fix now!
Thank you!