From 939b214db80da2282e8cd155b277e376bdafaaee Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Wed, 8 Feb 2017 07:58:24 +0000 Subject: [PATCH] say_many() can show an attachment with the first message. --- bot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 7998e3e..f6aeb4b 100644 --- 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: -- 2.7.4