Log new announcement ID.
authorCMDR furrycat <elite@furrycat.net>
Mon, 10 Oct 2016 10:22:03 +0000 (11:22 +0100)
committerCMDR furrycat <elite@furrycat.net>
Mon, 10 Oct 2016 10:22:03 +0000 (11:22 +0100)
bot.py

diff --git a/bot.py b/bot.py
index deac1f0..a6bbf9f 100755 (executable)
--- a/bot.py
+++ b/bot.py
@@ -1134,12 +1134,14 @@ def create_announcement(message, raw):
   if not announce:
     return
 
-  log.info('Creating announcement: {}'.format(create))
   id = db.create_announcement(client, **create)
   if id:
+    create['id'] = id
+    log.info('Created announcement: {}'.format(create))
     yield from say(message.channel, id)
     yield from play_sound(voice_channel_for_channel(message.channel), 'purr.wav', join = False)
   else:
+    log.info('Failed to create announcement: {}'.format(create))
     yield from say(message.channel, 'yelp!')
 
 @asyncio.coroutine