I want to write a text assistant on Telegram or VK. Where do we start?



  • I'd like to write a text assistant in. Telegram or VK in Python. There's already been a text assistant programming experience in Python. Here's the library. pyTelegramBotAPI I didn't work much. VkAPI I didn't work at all. Already found them through pip-- pip install pyTelegramBotAPI and pip install VkAPI♪ It's kind of normal. Please indicate:

    1. What better to do-- Telegram or VK?
    2. Why start?

    P. S. I can write as an assistant myself.



  • What better do you do, Telegram or VK?

    You'd better answer that question yourself. Depends on where you want to make your own bot, as well as on both platforms.

    Why start?

    If you start something simple, I can tell you about the library. https://vkbottle.readthedocs.io/ru/latest/ ♪ Pretty simple, totally typified, has a lot of ready things, asynchronous. A new function could be added to several lines.

    So it's gonna look like a simple bot responding to "Hi"

    from vkbottle.bot import Bot, Message
    

    bot = Bot(token="token")

    @bot.on.message(text="Привет")
    async def hi_handler(message: Message):
    users_info = await bot.api.users.get(message.from_id)
    await message.answer("Привет, {}".format(users_info[0].first_name))

    bot.run_forever()



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2