def cmd_set_generic(bot: telegram.Bot, update: telegram.Update, field_name: str,
cmd_name: str, example: str):
if generic_checks(bot, update, cmd_name, example, 2):
# Extract value
text = update.message.text
cmd, tag, value = text.split(" ", 2)
# Apply edit and
edit_poll(tag, field_name, value)
# send "success" feedback message
new_p = get_poll(tag)
msg = text_edit_successful.format(p=new_p)
cid = update.message.chat_id
bot.sendMessage(cid, msg)
# Check if complete, and suggest to activate
if check_if_complete(tag):
msg2 = text_activate_suggestion.format(t=tag)
bot.sendMessage(cid, msg2, parse_mode="Markdown")
else:
# A generic check failed.
pass
return
评论列表
文章目录