diff --git a/dist/vk_callback-1.0.1.tar.gz b/dist/vk_callback-1.0.1.tar.gz
new file mode 100644
index 0000000..6222d6e
Binary files /dev/null and b/dist/vk_callback-1.0.1.tar.gz differ
diff --git a/setup.py b/setup.py
index 6eb1c3d..a2ac60a 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
setup(name='vk_callback',
- version='1.0',
+ version='1.0.1',
description='Develop vk callback applications and bots',
packages=['vk_callback'],
author_email='ill2gms@ya.ru',
diff --git a/vk_callback.egg-info/PKG-INFO b/vk_callback.egg-info/PKG-INFO
new file mode 100644
index 0000000..6f883ca
--- /dev/null
+++ b/vk_callback.egg-info/PKG-INFO
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: vk-callback
+Version: 1.0.1
+Summary: Develop vk callback applications and bots
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: ill2gms@ya.ru
+License: UNKNOWN
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/vk_callback.egg-info/SOURCES.txt b/vk_callback.egg-info/SOURCES.txt
new file mode 100644
index 0000000..f9c270a
--- /dev/null
+++ b/vk_callback.egg-info/SOURCES.txt
@@ -0,0 +1,8 @@
+setup.cfg
+setup.py
+vk_callback/__init__.py
+vk_callback.egg-info/PKG-INFO
+vk_callback.egg-info/SOURCES.txt
+vk_callback.egg-info/dependency_links.txt
+vk_callback.egg-info/not-zip-safe
+vk_callback.egg-info/top_level.txt
\ No newline at end of file
diff --git a/vk_callback.egg-info/dependency_links.txt b/vk_callback.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/vk_callback.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/vk_callback.egg-info/not-zip-safe b/vk_callback.egg-info/not-zip-safe
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/vk_callback.egg-info/not-zip-safe
@@ -0,0 +1 @@
+
diff --git a/vk_callback.egg-info/top_level.txt b/vk_callback.egg-info/top_level.txt
new file mode 100644
index 0000000..5249e28
--- /dev/null
+++ b/vk_callback.egg-info/top_level.txt
@@ -0,0 +1 @@
+vk_callback
diff --git a/vk_callback/__init__.py b/vk_callback/__init__.py
index 8226cdc..2c6385a 100644
--- a/vk_callback/__init__.py
+++ b/vk_callback/__init__.py
@@ -1,9 +1,202 @@
-import flask
+import flask, traceback
from flask import Flask, render_template, request, redirect, url_for, flash, make_response, jsonify, send_file, abort
-from .vk_callback_data import docs as vk_docs
-from .vk_callback_data import tools as vk_tools
-import traceback
+
+class vk_docs: # Fuck you twine!!!
+ hostname = 'http://localhost:5050'
+
+ docs_info = {
+ "ru": '''
+
+
+ Как подключить callback
+
+
+
+
+
Введение и написание кода
+
Наш модуль написан для работы с callback событиями серверов vk.com и создания ботов на принципе callback. Этот метод подходит для нагруженных проектов, которые соединяют в себе несколько ботов, образуя сеть ботов.
+
Итак, наш модуль имеет следующие классы: server, group, vk_event, vk_callbackException. Чтобы вы могли написать бота, вам нужны только два из них: server и group. Перейдём непосрдественно к коду:
+
Для начала, мы должны создать класс, который наследуется от класса server и создадим там метод event со следующими аргументами:
+
import vk_callback
+
+
+class bot(vk_callback.server):
+ def event(self, group_obj, Event):
+ pass # Сюда будем писать код
+
group_obj отвечает за объект группы, Event - это объект события.
+
У group_obj есть следующие параметры: id, return_str, secret_key. Для разработки бота нам достаточно только id, где id это id группы.
+
У Event есть следующие параметры: type, object, group_id, event_id, secret (всё тоже самое, что и в объекте события вк). Для object это словарь с параметрами объекта события.
+
Проверять секретный ключ нет необходимости, за это отвечает метод класса confirmation_secret. Перейдём же к самому интересному... Давайте подключим двух ботов и сделаем для них разные ответы, чтобы отчётливее продемонстрировать возможности ботов:
+
К нашему методу event мы добавим код, который мы хотим реализовать. Далее, мы ниже создаём объект класса bot и добавляем туда объекты класса group, которые будут являться объектами групп, к которым мы подключили callback. Затем, запускаем нашего бота
+
import vk_callback
+import vk_api
+import random
+
+
+class bot(vk_callback.server):
+ def event(self, group_obj, Event):
+ bot_1 = vk_api.VkApi(token='***').get_api()
+ bot_2 = vk_api.VkApi(token='***').get_api()
+ if Event.type == 'message_new':
+ if group_obj.id == 12345678:
+ bot_1.messages.send(peer_id=Event.object['peer_id'], random_id=random.randint(0, 999999), message='hello')
+ else:
+ bot_2.messages.send(peer_id=Event.object['peer_id'], random_id=random.randint(0, 999999), message='hi')
+
+
+bot = bot(host='website.ru', groups=[
+ vk_callback.group(12345678, return_str="11693324", secret_key="secret_key_here"),
+ vk_callback.group(87654321, return_str="1af47ed9", secret_key="secret_key_here")
+], port=8080)
+
+bot.start()
+
Как подключить callback
+
Подключить callback сервер к вашей группе очень просто! Для начала, заходим в настройки группы в раздел "работа с API", затем заходим в раздел callback
+
+
+
+ 
+
Затем, нам нужно выбрать в настройках события, которые мы будем обрабатывать
+
+
+ 
+
Отлично! Теперь мы можем приступить к подключению нашего сервера. Для начала, скопируем что должен вернуть при подтверждении бот и его секретный ключ и вставим в код нашей программы, также скинем в объект айди нашей группы.
+
+ 
+
Запускаем сервер, в графе адреса заполняем адрес нашего сервера в формате crthst::rpl/айди_группы
+

+
Жмём подтвердить. Поздравляем, бот подключен!
+
+
+''',
+ "en": '''
+
+
+ Как подключить callback
+
+
+
+
+
Introduction and code writing
+
Our module is designed to work with server callback events vk.com and creating bots based on the callback principle. This method is suitable for loaded projects that combine several bots to form a network of bots.
+
So, our module has the following classes: server, group, vk_event, vk_callbackException. In order for you to write a bot, you only need two of them: server & group. Let's go straight to the code:
+
First, we need to create a class that inherits from the server class and create the event method there with the following arguments:
+
import vk_callback
+
+
+class bot(vk_callback.server):
+ def event(self, group_obj, Event):
+ pass # Here we will write the code
+
group_obj is responsible for the group object, Event is the event object.
+
group_obj has the following parameters: id, return_str, secret_key. To develop a bot, we only need an id, where id is the group id.
+
Event has the following parameters: type, object, group_id, event_id, secret (all the same as in the vk event object). For object, this is a dictionary with parameters for the event object.
+
There is no need to check the secret key.The method of the confirmation_secret class is responsible for this. Let's move on to the most interesting part... Let's connect two bots and make different responses for them to better demonstrate the capabilities of bots:
+
To our event method, we will add the code that we want to implement. Next, we create an object of the bot class below and add objects of the groupclassthere, which will be objects of the groups to which we connected the callback. Then, we launch our bot
+
import vk_callback
+import vk_api
+import random
+
+
+class bot(vk_callback.server):
+ def event(self, group_obj, Event):
+ bot_1 = vk_api.VkApi(token='***').get_api()
+ bot_2 = vk_api.VkApi(token='***').get_api()
+ if Event.type == 'message_new':
+ if group_obj.id == 12345678:
+ bot_1.messages.send(peer_id=Event.object['peer_id'], random_id=random.randint(0, 999999), message='hello')
+ else:
+ bot_2.messages.send(peer_id=Event.object['peer_id'], random_id=random.randint(0, 999999), message='hi')
+
+
+bot = bot(host='website.ru', groups=[
+ vk_callback.group(12345678, return_str="11693324", secret_key="secret_key_here"),
+ vk_callback.group(87654321, return_str="1af47ed9", secret_key="secret_key_here")
+], port=8080)
+
+bot.start()
+
How to connect callback
+
Connecting a callback server to your group is very simple! First, go to the group settings in the "API usage", section, then go to the callback section
+
+
+
+ 
+
Then, we need to select the events that we will process in the settings
+
+
+ 
+
Great! Now we can start connecting our server. To begin with, we will copy what the bot should return when confirming and its secret key and paste it into the code of our program, as well as throw it into the ID object of our group.
+
+ 
+
Starting the server, in the address column, fill in the address of our server in the format crthst::rpl/group_id
+

+
Click confirm. Congratulations, the bot is connected!
+
+
+'''
+ }
+
+ for lang in docs_info:
+ docs_info[lang] = docs_info[lang].replace('crthst::rpl', hostname)
+
+
+class vk_tools: # Fuck you PyPl!!!
+ def repl_to_dict(args):
+ # print(args)
+ data = dict()
+ for arg in args:
+ data[arg] = args[arg]
+ # print(data)
+ return data
+
app = Flask(__name__)
diff --git a/vk_callback/vk_callback_data/__pycache__/docs.cpython-36.pyc b/vk_callback/vk_callback_data/__pycache__/docs.cpython-36.pyc
deleted file mode 100644
index d13fdff..0000000
Binary files a/vk_callback/vk_callback_data/__pycache__/docs.cpython-36.pyc and /dev/null differ
diff --git a/vk_callback/vk_callback_data/__pycache__/tools.cpython-36.pyc b/vk_callback/vk_callback_data/__pycache__/tools.cpython-36.pyc
deleted file mode 100644
index 181cd42..0000000
Binary files a/vk_callback/vk_callback_data/__pycache__/tools.cpython-36.pyc and /dev/null differ
diff --git a/vk_callback/vk_callback_data/docs.py b/vk_callback/vk_callback_data/docs.py
deleted file mode 100644
index 584be9e..0000000
--- a/vk_callback/vk_callback_data/docs.py
+++ /dev/null
@@ -1,183 +0,0 @@
-hostname = 'http://localhost:5050'
-
-docs_info = {
- "ru": '''
-
-
- Как подключить callback
-
-
-
-
-
Введение и написание кода
-
Наш модуль написан для работы с callback событиями серверов vk.com и создания ботов на принципе callback. Этот метод подходит для нагруженных проектов, которые соединяют в себе несколько ботов, образуя сеть ботов.
-
Итак, наш модуль имеет следующие классы: server, group, vk_event, vk_callbackException. Чтобы вы могли написать бота, вам нужны только два из них: server и group. Перейдём непосрдественно к коду:
-
Для начала, мы должны создать класс, который наследуется от класса server и создадим там метод event со следующими аргументами:
-
import vk_callback
-
-
-class bot(vk_callback.server):
- def event(self, group_obj, Event):
- pass # Сюда будем писать код
-
group_obj отвечает за объект группы, Event - это объект события.
-
У group_obj есть следующие параметры: id, return_str, secret_key. Для разработки бота нам достаточно только id, где id это id группы.
-
У Event есть следующие параметры: type, object, group_id, event_id, secret (всё тоже самое, что и в объекте события вк). Для object это словарь с параметрами объекта события.
-
Проверять секретный ключ нет необходимости, за это отвечает метод класса confirmation_secret. Перейдём же к самому интересному... Давайте подключим двух ботов и сделаем для них разные ответы, чтобы отчётливее продемонстрировать возможности ботов:
-
К нашему методу event мы добавим код, который мы хотим реализовать. Далее, мы ниже создаём объект класса bot и добавляем туда объекты класса group, которые будут являться объектами групп, к которым мы подключили callback. Затем, запускаем нашего бота
-
import vk_callback
-import vk_api
-import random
-
-
-class bot(vk_callback.server):
- def event(self, group_obj, Event):
- bot_1 = vk_api.VkApi(token='***').get_api()
- bot_2 = vk_api.VkApi(token='***').get_api()
- if Event.type == 'message_new':
- if group_obj.id == 12345678:
- bot_1.messages.send(peer_id=Event.object['peer_id'], random_id=random.randint(0, 999999), message='hello')
- else:
- bot_2.messages.send(peer_id=Event.object['peer_id'], random_id=random.randint(0, 999999), message='hi')
-
-
-bot = bot(host='website.ru', groups=[
- vk_callback.group(12345678, return_str="11693324", secret_key="secret_key_here"),
- vk_callback.group(87654321, return_str="1af47ed9", secret_key="secret_key_here")
-], port=8080)
-
-bot.start()
-
Как подключить callback
-
Подключить callback сервер к вашей группе очень просто! Для начала, заходим в настройки группы в раздел "работа с API", затем заходим в раздел callback
-
-
-
- 
-
Затем, нам нужно выбрать в настройках события, которые мы будем обрабатывать
-
-
- 
-
Отлично! Теперь мы можем приступить к подключению нашего сервера. Для начала, скопируем что должен вернуть при подтверждении бот и его секретный ключ и вставим в код нашей программы, также скинем в объект айди нашей группы.
-
- 
-
Запускаем сервер, в графе адреса заполняем адрес нашего сервера в формате crthst::rpl/айди_группы
-

-
Жмём подтвердить. Поздравляем, бот подключен!
-
-
-''',
- "en": '''
-
-
- Как подключить callback
-
-
-
-
-
Introduction and code writing
-
Our module is designed to work with server callback events vk.com and creating bots based on the callback principle. This method is suitable for loaded projects that combine several bots to form a network of bots.
-
So, our module has the following classes: server, group, vk_event, vk_callbackException. In order for you to write a bot, you only need two of them: server & group. Let's go straight to the code:
-
First, we need to create a class that inherits from the server class and create the event method there with the following arguments:
-
import vk_callback
-
-
-class bot(vk_callback.server):
- def event(self, group_obj, Event):
- pass # Here we will write the code
-
group_obj is responsible for the group object, Event is the event object.
-
group_obj has the following parameters: id, return_str, secret_key. To develop a bot, we only need an id, where id is the group id.
-
Event has the following parameters: type, object, group_id, event_id, secret (all the same as in the vk event object). For object, this is a dictionary with parameters for the event object.
-
There is no need to check the secret key.The method of the confirmation_secret class is responsible for this. Let's move on to the most interesting part... Let's connect two bots and make different responses for them to better demonstrate the capabilities of bots:
-
To our event method, we will add the code that we want to implement. Next, we create an object of the bot class below and add objects of the groupclassthere, which will be objects of the groups to which we connected the callback. Then, we launch our bot
-
import vk_callback
-import vk_api
-import random
-
-
-class bot(vk_callback.server):
- def event(self, group_obj, Event):
- bot_1 = vk_api.VkApi(token='***').get_api()
- bot_2 = vk_api.VkApi(token='***').get_api()
- if Event.type == 'message_new':
- if group_obj.id == 12345678:
- bot_1.messages.send(peer_id=Event.object['peer_id'], random_id=random.randint(0, 999999), message='hello')
- else:
- bot_2.messages.send(peer_id=Event.object['peer_id'], random_id=random.randint(0, 999999), message='hi')
-
-
-bot = bot(host='website.ru', groups=[
- vk_callback.group(12345678, return_str="11693324", secret_key="secret_key_here"),
- vk_callback.group(87654321, return_str="1af47ed9", secret_key="secret_key_here")
-], port=8080)
-
-bot.start()
-
How to connect callback
-
Connecting a callback server to your group is very simple! First, go to the group settings in the "API usage", section, then go to the callback section
-
-
-
- 
-
Then, we need to select the events that we will process in the settings
-
-
- 
-
Great! Now we can start connecting our server. To begin with, we will copy what the bot should return when confirming and its secret key and paste it into the code of our program, as well as throw it into the ID object of our group.
-
- 
-
Starting the server, in the address column, fill in the address of our server in the format crthst::rpl/group_id
-

-
Click confirm. Congratulations, the bot is connected!
-
-
-'''
-}
-
-for lang in docs_info:
- docs_info[lang] = docs_info[lang].replace('crthst::rpl', hostname)
\ No newline at end of file
diff --git a/vk_callback/vk_callback_data/tools.py b/vk_callback/vk_callback_data/tools.py
deleted file mode 100644
index 35f7434..0000000
--- a/vk_callback/vk_callback_data/tools.py
+++ /dev/null
@@ -1,7 +0,0 @@
-def repl_to_dict(args):
- # print(args)
- data = dict()
- for arg in args:
- data[arg] = args[arg]
- # print(data)
- return data
\ No newline at end of file