def get_auto_brand(bot: Bot, update: Update, user_data: dict) -> int: uid = update.message.from_user.id message = update.message.text if is_back(message): return start(bot, update) user_data['brand'] = message send_params = { 'chat_id': uid, 'text': 'Отлично! Что нужно починить?', 'parse_mode': ParseMode.HTML, 'reply_markup': ReplyKeyboardMarkup(back, resize_keyboard=1) } user_data['get_auto_brand'] = send_params bot.send_message(**send_params) return GET_REPAIR_DESCRIPTION
from bot.bot import start from exception.exception import ConfigDoesNotExist from parse_config.parse_config import parse if __name__ == "__main__": try: token, backend, db, filename = parse("config", "config.yaml") except ConfigDoesNotExist as e: print(repr(e)) exit() start(token, backend, db, filename)
from bot import bot import secrets.twitch import asyncio import time if __name__ == "__main__": print("Booting ...") username = secrets.twitch.USERNAME app_id = secrets.twitch.APP_ID token = secrets.twitch.OAUTH_TOKEN channels = ["ricklesauceur"] irc = irc.IRCInterface(username, app_id, token, channels) irc.start() bot = bot.Bot() bot.irc_interface = irc bot.start() print("Running forever ...") try: while True: irc.run(forever=False) bot.tick() time.sleep(0.01) except KeyboardInterrupt: pass
def main(): bot.start() # print_all_docs() pass
from bot import bot from config import TOKEN if __name__ == '__main__': bot.start(TOKEN)
def run_bot(): print("Bot started...") bot.start()
from bot.bot import start from exception.exception import ConfigDoesNotExist from parse_config.parse_config import parse if __name__ == "__main__": try: token, backend, db, dialog, filename = parse("config", "config.yaml") except ConfigDoesNotExist as e: print(repr(e)) exit() start(token, backend, db, dialog, filename)
from bot.bot import start from exception.exception import ConfigDoesNotExist from parse_config.parse_config import parse if __name__ == "__main__": try: token, backend, filename, model_name, size = parse("config", "config.yaml") except ConfigDoesNotExist as e: print(repr(e)) exit() start(token, backend, filename, model_name, size)
# coding=utf-8 import time __author__ = 'Invalid' from bot import bot if __name__ == '__main__': print "xxx1" c = bot.start() time.sleep(5) print "xxx2" # bot.stop() print "xxx3" time.sleep(5) print "xxx4"