def commandImp(msg): autoDestroy(msg) command, text = splitCommand(msg.text) if "s4_g" in command: return msg.reply_text(iterateMessage(msg.chat.id), quote=False) elif matchKey(command, ["s4_source_add", "s4_sa", "s4_a"]): autoDestroy(msg.reply_text(Source.add(text))) elif matchKey(command, ["s4_source_delete", "s4_sd", "s4_d"]): autoDestroy(msg.reply_text(Source.remove(text))) elif matchKey(command, ["s4_source_list", "s4_sl", "s4_l"]): pass # intentional elif matchKey(command, ["s4_sub", "s4_s"]): Subscription.add(msg.chat.id, text) else: return if matchKey(command, ["s4_source", "s4_sl", "s4_l", "s4_sa", "s4_a", "s4_sd", "s3_d"]): sources = ['[%s](t.me/%s)' % (chatname, chatname) for \ chatname in Source.db.keys()] autoDestroy(msg.reply_text('Source list: \n' + '\n'.join(sources), parse_mode='Markdown', disable_web_page_preview=True)) else: autoDestroy(msg.reply_text("success"))