def process(chat_id, message, date): chat = Chat(chat_id) if chat.is_exist() == False: chat.create() channels = config.get("channels"); for channel in channels: chat.subscribe(channel["name"], Type.Auto) bot.broadcast_message(chat_id, str(config.get("hello_message"))); return; try: command = bot.decode_command(message) args = message.split() args.pop(0) bot.execute(command, chat_id, args, date) except KeyError: print "Nothing to command" return chat
def process(chat_id, message, date): chat = Chat(chat_id) if chat.is_exist() == False: chat.create() channels = config.get("channels") for channel in channels: chat.subscribe(channel["name"], Type.Auto) bot.broadcast_message(chat_id, str(config.get("hello_message"))) return try: command = bot.decode_command(message) args = message.split() args.pop(0) bot.execute(command, chat_id, args, date) except KeyError: print "Nothing to command" return chat