say_many() can show an attachment with the first message.
authorCMDR furrycat <elite@furrycat.net>
Wed, 8 Feb 2017 07:58:24 +0000 (07:58 +0000)
committerCMDR furrycat <elite@furrycat.net>
Wed, 8 Feb 2017 07:58:32 +0000 (07:58 +0000)
bot.py

diff --git a/bot.py b/bot.py
index 7998e3e..f6aeb4b 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -392,7 +392,7 @@ def say(channel, text, *, attachment = None, wake = None):
   return message
 
 @asyncio.coroutine
-def say_many(channel, lines, *, maxlen = 2000):
+def say_many(channel, lines, *, attachment = None, maxlen = 2000):
   while len(lines):
     message_len = 0
     n = 0
@@ -404,10 +404,11 @@ def say_many(channel, lines, *, maxlen = 2000):
     # We can't print too big a message.
     subset = lines[:n]
     message = '\n'.join(subset)
-    result = yield from say(channel, message)
+    result = yield from say(channel, message, attachment = attachment)
     if not result:
       break
     lines = lines[len(subset):]
+    attachment = None
 
 def voice_channel_for_channel(channel):
   for voice in client.voice_clients: