return parsed
@asyncio.coroutine
-def maybe_say(channel, text, *, attachment = None, probability = 0.2, wake = True):
+def maybe_say(channel, text, *, attachment = None, embed = None, probability = 0.2, wake = True):
if random.random() <= probability:
yield from client.send_typing(channel)
message = None
else:
log.warning("Missing or invalid attachment!")
if message is None:
- message = yield from client.send_message(channel, text)
+ message = yield from client.send_message(channel, text, embed = embed)
if wake:
yield from wake_up()
return message
return None
@asyncio.coroutine
-def say(channel, text, *, attachment = None, wake = None):
+def say(channel, text, *, attachment = None, embed = None, wake = None):
args = { 'probability': 1.0 }
if attachment is not None:
args['attachment'] = attachment
+ if embed is not None:
+ args['embed'] = embed
if wake is not None:
args['wake'] = wake
message = yield from maybe_say(channel, text, **args)
return message
@asyncio.coroutine
-def say_many(channel, lines, *, attachment = None, maxlen = 2000):
+def say_many(channel, lines, *, attachment = None, embed = None, maxlen = 2000):
while len(lines):
message_len = 0
n = 0
# We can't print too big a message.
subset = lines[:n]
message = '\n'.join(subset)
- result = yield from say(channel, message, attachment = attachment)
+ result = yield from say(channel, message, attachment = attachment, embed = embed)
if not result:
break
lines = lines[len(subset):]
attachment = None
+ embed = None
def voice_channel_for_channel(channel):
for voice in client.voice_clients: