From 3de4f1662216dfe24e91d7ee6b3dce46e3637a74 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 27 Dec 2021 22:09:35 +0000 Subject: [PATCH] Format return from creating ad --- handler/irc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/handler/irc.py b/handler/irc.py index eef89bd..d753f73 100644 --- a/handler/irc.py +++ b/handler/irc.py @@ -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