def main(): """Start the bot.""" # Connect the bot to number. bot = Bot("+xxxxxxxxxxx") # Add handlers to bot. bot.register_handler("!bbc info", bbc_info) bot.register_handler(re.compile("!bbc (.*)"), bbc_feed) bot.register_handler("!bbc", bbc_feed) # Run the bot until you press Ctrl-C. bot.start()
async def main(): """Start the bot.""" # Connect the bot to number. async with Bot(os.environ["SIGNAL_PHONE_NUMBER"]) as bot: bot.register_handler("!xkcd", xkcd) # Run the bot until you press Ctrl-C. await bot.start()
async def main(): """Start the bot.""" # Connect the bot to number. async with Bot(os.environ["SIGNAL_PHONE_NUMBER"]) as bot: bot.register_handler(re.compile("!btc unset"), unset_notification) bot.register_handler(re.compile("!btc (.*)"), set_notification) # Run the bot until you press Ctrl-C. await bot.start()
async def main(): """Start the bot.""" # Connect the bot to number. async with Bot(os.environ["SIGNAL_PHONE_NUMBER"]) as bot: bot.register_handler("", raise_exception) bot.set_exception_handler(exception_handler) # Run the bot until you press Ctrl-C. await bot.start()
def main(): """Start the bot.""" # Connect the bot to number. bot = Bot("+xxxxxxxxxxx") # Add timer handler. bot.register_handler(re.compile("!timer unset"), unset_timer) bot.register_handler(re.compile("!timer (.*)"), set_timer) # Run the bot until you press Ctrl-C. bot.start()
async def main(): """Start the bot.""" # Connect the bot to number. async with Bot(os.environ["SIGNAL_PHONE_NUMBER"]) as bot: bot.register_handler("!subscribe", subscribe) bot.register_handler("!unsubscribe", unsubscribe) bot.register_handler("!broadcast", broadcast) # Run the bot until you press Ctrl-C. await bot.start()
async def main(): """Start the bot.""" # Connect the bot to number. async with Bot(os.environ["SIGNAL_PHONE_NUMBER"]) as bot: bot.register_handler(re.compile("!timer unset (.*)"), unset_timer) bot.register_handler(re.compile("!timer list"), list_timers) bot.register_handler(re.compile("!timer (.*)"), set_timer) # Run the bot until you press Ctrl-C. await bot.start()
async def main(): """Start the bot.""" # Connect the bot to number. async with Bot(os.environ["SIGNAL_PHONE_NUMBER"]) as bot: bot.register_handler("!bbc info", bbc_info) bot.register_handler(re.compile("!bbc (.*)"), bbc_feed) bot.register_handler("!bbc", bbc_feed) # Run the bot until you press Ctrl-C. await bot.start()
def main(): """Start the bot.""" # Connect the bot to number. bot = Bot("+xxxxxxxxxxx") # Add handler to bot. bot.register_handler("", quote) # Run the bot until you press Ctrl-C. bot.start()