def start_handler(message): bot.send_chat_action(message.chat.id, 'typing') if is_sign_in(message.chat.id): bot.send_message(message.chat.id, "Start by sending me a message?") return msg = 'Welcome to TeleTweet. ' \ 'This bot will connect you from Telegram Bot to Twitter. ' \ 'Want to get started now? Type /sign_in now!' bot.send_message(message.chat.id, msg)
def start_handler(message): bot.send_chat_action(message.chat.id, 'typing') if is_sign_in(message.chat.id): bot.send_message(message.chat.id, "Start by sending me a message?") return msg = 'Welcome to TeleTweet. ' \ 'This bot will connect you from Telegram Bot to Twitter. ' \ 'Want to get started now? Type /sign_in now!' if ALLOW_USER != ['']: msg += "\n\nTHIS BOT IS ONLY AVAILABLE TO CERTAIN USERS. Contact creator for help." bot.send_message(message.chat.id, msg)
def sign_off_handler(message): bot.send_chat_action(message.chat.id, 'typing') if not is_sign_in(str(message.chat.id)): bot.send_message( message.chat.id, "Lazarus came back from the dead.\nYou haven't signed in yet.") return sign_off(str(message.chat.id)) msg = "I'm sorry to see you go. I have delete your oauth token." \ "By the way, you could also check [this link](https://twitter.com/settings/connected_apps)." bot.send_message(message.chat.id, msg, parse_mode='markdown')
def sign_in_handler(message): if is_sign_in(message.chat.id): bot.send_message( message.chat.id, "You have already signed in, no need to do it again.") return bot.send_chat_action(message.chat.id, 'typing') msg = 'Click this [link](https://teletweet.app) to login in you twitter.' \ ' When your login in is done, send auth code back to me' bot.send_message(message.chat.id, msg, parse_mode='markdown') bot.register_next_step_handler(message, next_step_add_auth)