Skip to content

Stepan-coder/Quanario_VK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quanario_VK - Module for the development of chatbots in the social network VKontakte

Logo

Table of contents

Introduction

    In 2019, I wanted to make a chatbot for learning foreign languages, I do not know exactly why, but I really wanted to. But I liked the idea that you can make some kind of resource that is accessed through a messenger. In general, in my opinion, resources should be divided into two types: exclusively informational and design. For example, I would refer Wikipedia or the library's website to the informational ones, and an online store, a website apple.com to the design. This approach organizes resources according to their purpose.
    To create my own bot, I began to study the Internet for what and how to do. Of course, the first thing I came across was instructions for creating bots in telegram. But only in my opinion telegram is already overloaded with all kinds of bots and, unfortunately, does not have the resources to popularize the group with the exception of paid advertising in other groups.
    Later, I came across the vk_api library from python273. I liked it for its simplicity and convenience. Having added my own features to the project code, I implemented the project LinguisticBot.
    But as the project developed and scaled, I realized that the current capabilities of the library are not enough and it needs quite serious refinement. Therefore, in the format of a pet project, I decided to bring it to mind! Now, this project is a serious rethinking of the principles of the original library, as well as the appearance of new features:

  • clear typing,
  • castomisation,
  • asynchrony,
  • adequate operation of the keyboard,
  • the appearance of the carousel object,
  • the ability to receive and process attachments from the user (including geo-location)
  • and much more!

|->quanario - root folder of the project.
     ∟ bot.py - the main class of the module. Learn more.
     ∟ send.py - class for sending messages and attachments to the user. Learn more.
     ∟ upload.py - class for uploading attachments to the VKontakte server. Learn more.
     |-> message_extensions
         ∟ carousel.py - class that implements the functionality of the carousel element. Learn more.
         ∟ keyboard.py - class that implements the functionality of the keyboard element. Learn more.
     |-> input_message
         ∟ message.py - main class for processing messages from the user, including attachments. Learn more.
         ∟ voice.py - class for working with attachments of the voice message type. Learn more.
         ∟ audio.py - class for working with attachments of the audio or music types. Learn more.
         ∟ photo.py - class for working with attachments of the photo type. Learn more.
         ∟ video.py - class for working with attachments of the video type. Learn more.
         ∟ file.py - class for working with attachments of the file or document types. Learn more.
         ∟ geoposition.py - class for working with attachments of the geo type. Learn more.
     |-> user
         ∟ user.py - main class for processing user information. Learn more.
         ∟ career.py - class with information about fields from the Career section. Learn more.
         ∟ contacts.py - class with information about fields from the Contacts section. Learn more.
         ∟ counters.py - class with information about the number of different objects the user has. Learn more.
         ∟ interests.py - class with information about fields from the Interests section. Learn more.
         ∟ last_seen.py - a class with information about the user's last visit. Learn more.
         ∟ lifeposition.py - class with information about fields from the Life position section. Learn more.
         ∟ military.py - class with information about fields from the Military section. Learn more.
         ∟ occupation.py - class with information about the user's current occupation. Learn more.
         ∟ params.py - class with information about fields from the Params section. Learn more.
         |-> education
             ∟ education.py - main class for processing user information about his education. Learn more.
             ∟ schools.py - class with information about which schools the user attended. Learn more.
             ∟ universities.py - class with information about which universities the user attended. Learn more.


Installation

Will be soon... But for now, you can just add the quanario folder to the root of your project and use it as a regular library.

Usage

To start development, you need to install the module (see the installation section) and import it into your project. An example of the simplest echo bot:

See an example

from quanario.bot import *


def send_keyboard(bot: Bot, message: Message, args: tuple = None):
    pass

TOKEN = "*YOUR TOKEN*"
APP_ID = 000000000

bot = Bot(token=TOKEN, app_id=APP_ID)
bot.run(init_method=send_keyboard)

You also have the opportunity to get acquainted with other, more complex examples, to do this, follow one of the links below.
|-> Echo
     ∟ To view the text example, click here.
     ∟ To view the audio example, click here.
     ∟ To view the photo example, click here.
     ∟ To view the video example, click here.
     ∟ To view the file example, click here.
|-> Keyboard
     ∟ To view the keyboard example, click here.
|-> Carousel
     ∟ To view the carousel example, click here.
|-> Geoposition
     ∟ To view the geoposition example, click here.

LinguisticBotLogo

As an example, I can demonstrate the community on VKontakte - LinguisticBot. This is my community for learning foreign languages for everyone. It implements all the modules of this educational school website. The bot provides 6 types of interactive tasks to increase the user's vocabulary, as well as an audition task. In addition, as an example, a store has been implemented in which you can buy tips and sections with listening. This project has been running nonstop for 2 years. During this period, a huge number of bugs and bugs in the library have been fixed Quanario_VK

FAQ

I'm just launching this project, but if you have any questions, you can always ask in issues or in our telegram chat or VKontakte group.

сс-nc-by-license

CC-BY-NC and commercial usage available after agreement with Quanario_VK authors.

Commerical inquiries

Further reading

Will be soon...

Alternatives

Of course, I'am not the first to decide to make a library for ourselves, so I give alternatives, perhaps you will find them more convenient for yourself:

I believe that using my development will be pleasant for you!

About

For the first time, a normally implemented module for creating VK bots...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages