Format return from creating ad

This commit is contained in:
Mark Veidemanis 2021-12-27 22:09:35 +00:00
parent aa8041e190
commit 3de4f16622
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 4 additions and 1 deletions

View File

@ -65,7 +65,10 @@ class IRCBot(irc.IRCClient):
elif cmd == "create" and host in self.admins and len(spl) == 3:
# Post an ad on AgoraDesk with the given country and currency code
posted = self.agora.create_ad(spl[1], spl[2])
self.msg(channel, dumps(posted))
if posted["success"]:
self.msg(channel, f"{posted['response']['data']['message']}: {posted['response']['data']['ad_id']}")
else:
self.msg(channel, posted["response"]["data"]["message"])
elif cmd == "messages" and host in self.admins and len(spl) == 1:
# Get all messages for all open trades