filename = 'meow.wav'
try:
+ logtext = text
+ if not logtext:
+ if attachment is not None:
+ logtext = attachment['filename']
+ else:
+ logtext = 'No text'
if bot.get('dryrun'):
if not already_posted:
if voice_only:
log.info('Dryrun: Not playing announcement {} {} in {}'.format(announcement['id'], filename, channel))
else:
- log.info('Dryrun: Not posting announcement {} to {}: {}'.format(announcement['id'], channel, text))
+ log.info('Dryrun: Not posting announcement {} to {}: {}'.format(announcement['id'], channel, logtext))
else:
announce = random.random() <= announcement['probability'] if not already_posted else 0
if announce:
if voice_only:
yield from bot.wake_up()
else:
- log.info('Posting announcement {} to {}: {}'.format(announcement['id'], channel, text))
+ log.info('Posting announcement {} to {}: {}'.format(announcement['id'], channel, logtext))
message = yield from bot.say(channel, text, attachment = attachment)
update['digest'] = bot.digest(message.content)
else: