Simple VK API wrapper for Python

Overview

VK Admier: documentation

VK Admier is simple VK API wrapper for community bot development.

Authorization

You should create bot object from Client class for access to Admier's methods:

bot = admier.Client(<group_id: int>, <access_token: str>, <api_version: str>)

<group_id: int>

This is your community ID. You can get it there.

Remember, module works on behalf of your community.

<access_token: str>

This is your community token. The easiest way to get it is to create token in community settings. Find it there.

Application has to get this token. It gives access to VK API methods.

<api_version: str>

This is version of VK API service. It is not binding argument.

You can find relevant API version there.

Long Polling

VK Admier uses Long Poll Server to get events. So you should connect to it with Client.connect() function:

bot.connect(<handler: func>)

<handler: func>

Handle function which will process every event. It requires event argument.

If you need to filter some events, you can do it in community settings, otherwise you can check events programmatically:

def handle(event):
    # Is there a new message?
    if not(event["updates"]) or not(event["updates"][0]["type"] == "message_new"): return

    params = {
        "peer_id": event["updates"][0]["object"]["message"]["peer_id"],
        "random_id": 0,
        "message": "Hello World!"
    }
    bot.request("messages.send", params)

bot.connect(handle)

Ussage

Use Client.request() function to make VK API request:

bot.request(<method: str>, <parameters: dict>)

<method: str>

String value for method name. Find it, using official VK API documentation.

Remember, you can use methods with community token authorization only!

bot.request("messages.send", params)

<parameters: dict>

Dictionary with required parameters. Don't define default parameters like access_token, group_id, v.

params = {
    "peer_id": 2000000000,
    "random_id": 0,
    "message": "Hello World!"
}
bot.request("messages.send", params)

Example

You can use this template to create your bot:

import admier

# Your access_token is here
access_token = ""

# Your group_id is here
group_id = "" 

def handle(event): 
    # event handler, write your code here
    print(event)

bot = admier.Client(group_id, access_token)
bot.connect(handle)

You can check working example in the root of repository, but you have to edit group_id and access_token variables.

Owner
Egor Light
Hello!
Egor Light
A multi-password‌ cracking tool that can help you hack facebook accounts very quickly

FbCracker This is a multi-password‌ cracking tool that can help you hack facebook accounts very quickly. Facebook Hacking Tool Installation On Termux

ReD H4CkeR 9 Nov 16, 2022
AWS Workmail Migration Tool

WMigrate A tool for migrating AWS Workmail Users and Groups cross region and cross accounts. It also creates user and group aliases and adds the users

NK 1 Oct 27, 2021
🐍 VerificaC19 SDK implementation for Python

VerificaC19 Python SDK 🐍 VerificaC19 SDK implementation for Python. Requirements Python version = 3.7 Make sure zbar is installed in your system For

Lotrèk 10 Jan 14, 2022
The Discord bot framework for Python

Pycordia ⚠️ Note! As of now, this package is under early development so functionalities are bound to change drastically. We don't recommend you curren

Ángel Carias 24 Jan 01, 2023
Jackrabbit Relay is an API endpoint for stock, forex and cryptocurrency exchanges that accept REST webhooks.

JackrabbitRelay Jackrabbit Relay is an API endpoint for stock, forex and cryptocurrency exchanges that accept REST webhooks. Disclaimer Please note RA

Rose Heart 23 Jan 04, 2023
Valorant store offer discord-bot

Valorant store checker - Discord Bot Discord bot that shows your daily store offer without open the VALORANT by using the Ingame API. written using Py

STACIA 226 Jan 02, 2023
Source code for Profile REST API

PROJECT PROFILE REST API Creating local development server: We will create a local development server that can run and test our API as we build it. We

1 Mar 29, 2022
A Simple Telegram Inline Torrent Search Bot by @AbirHasan2005

A Simple Telegram Inline Torrent Search Bot by @AbirHasan2005

Abir Hasan 61 Oct 28, 2022
unofficial library for discord components(on development)

discord.py-buttons unofficial library for discord buttons(on development) Install pip install --upgrade discord_buttons Example from discord import Cl

kiki7000 129 Dec 31, 2022
Python based Spotify account generator.

Spotify Account Generator Python based Spotify account generator. Installation Download the latest release, open command prompt in the folder, run pip

polo 5 Dec 27, 2022
EC2 that automatically move files received through FTP to S3

ftp-ec2-s3-cf EC2 that automatically move files received through FTP to S3 Installation CloudFormation template Deploy now! Usage IP / domain name: ta

Javier Santana 1 Jun 19, 2021
Kali Kush - Account Nuker Tool

Kali Kush - Account Nuker Tool This is a discord tool made by me, and SSL :) antho#1731 How to use? pip3 install -r requirements.txt -py kalikush.py -

ryan 3 Dec 21, 2021
PunkScape Discord bot to lookup rarities, create diptychs and more.

PunkScape Discord Bot A Discord bot created for the Discord server of PunkScapes, a banner NFT project. It was intially created to lookup rarities of

Akuti 4 Jun 24, 2022
THERE IS AN IMPOSTER AMONG US. VOTE HIM OUT BEFORE HE [ R E D A C T E D ].

🛡️ Guardian There is an impostor among us. Can you help us find out who it is? ⚙️ Installation and Usage Make sure to install Tesseract-OCR before ru

Catus Magnus 1 Jan 06, 2022
A python crypto trading bot on Binance using RSI in 25 Lines 🚀

RSI Crypto Trading Bot - Binance A Crypto Trading Bot on Binance trading BTCUSDT and ETHUSDT using RSI in 25 Lines of Code Getting Started Note Python

Blankly Finance 10 Dec 26, 2022
A multipurpose Telegram Bot written in Python for mirroring files on the Internet to Google Drive

Mirror Leech Bot Mirror Leech Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Ba

1 Jan 01, 2022
This script will detect changes in your session using Discords built in Gateway.

Detect Session Gateway This script will detect changes in your session using Discords built in Gateway. What does this log? Discord build version Oper

Omega 5 Dec 18, 2021
Tools ini hanya bisa digunakan untuk menyerang website atau http/s

☢️ Tawkun DoS ☢️ Tools ini hanya bisa digunakan untuk menyerang website atau http/s FITUR: [ ☯️ ] Proxy Mode [ 🔥 ] SOCKS Mode | Kadang Eror [ ☢️ ] Ht

Bandhitawkunthi 9 Jul 19, 2022
A pypi package that helps in generating discord bots.

A pypi package that helps in generating discord bots.

KlevrHQ 3 Nov 17, 2021
A Discord bot themed around the Swedish heavy metal band Sabaton! (Python)

A Discord bot themed around the Swedish heavy metal band Sabaton! (Python)

Evan Lundberg 1 Nov 29, 2021