Velasco 2.4

- Added ability to force Velasco to answer to another message
(send command "/speak" as an answer to the message that you want Velasco
to reply to).
This commit is contained in:
vylion 2018-09-25 11:38:43 +02:00
parent edca56e23c
commit c6053724c8

View file

@ -179,11 +179,12 @@ def speak(bot, update):
if not user_is_admin(user):
return
reply_to = update.message.reply_to_message.message_id if update.message.reply_to_message else update.message.message_id
text = update.message.text.split()
if len(text) > 1:
chatlog.add_msg(' '.join(text[1:]))
msg = chatlog.speak()
send_message(bot, update, msg, update.message.message_id)
send_message(bot, update, msg, reply_to)
savechat(chatlog)
chatlogs[chatlog.id] = chatlog