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 Telegram Music Tag Editor Bot that can remove almost all usernames in the music tags and add own username instead.

Music Tag Editor Bot A Telegram Music Tag Editor Bot that can remove almost all usernames in the music tags and add own username instead. It can also

14 Oct 21, 2022
Python wrapper for Wikipedia

Wikipedia API Wikipedia-API is easy to use Python wrapper for Wikipedias' API. It supports extracting texts, sections, links, categories, translations

Martin Majlis 369 Dec 30, 2022
Simple library for logging to Loggly

#Hoover A python wrapper used to hit the Loggly. API For more information on Hoover see http://wiki.loggly.com/hooverguide ##Install With this git rep

Hoover Loggly 34 May 19, 2021
Huan Xu 1.6k Jan 04, 2023
๐€ ๐ฆ๐จ๐๐ฎ๐ฅ๐š๐ซ ๐“๐ž๐ฅ๐ž๐ ๐ซ๐š๐ฆ ๐†๐ซ๐จ๐ฎ๐ฉ ๐ฆ๐š๐ง๐š๐ ๐ž๐ฆ๐ž๐ง๐ญ ๐›๐จ๐ญ ๐ฐ๐ข๐ญ๐ก ๐ฎ๐ฅ๐ญ๐ข๐ฆ๐š๐ญ๐ž ๐Ÿ๐ž๐š๐ญ๐ฎ๐ซ๐ž๐ฌ

๐‡๐จ๐ฐ ๐“๐จ ๐ƒ๐ž๐ฉ๐ฅ๐จ๐ฒ For easiest way to deploy this Bot click on the below button ๐Œ๐š๐๐ž ๐๐ฒ ๐’๐ฎ๐ฉ๐ฉ๐จ๐ซ๐ญ ๐†๐ซ๐จ๐ฎ๐ฉ ๐’๐จ๐ฎ๐ซ๐œ๐ž๐ฌ ๐†๐ž๐ง๐ž?

Mukesh Solanki 2 Oct 06, 2021
Discord Webhook Spammer (fastest)

Discord Webhook Spammer A simple fast asynchronous webhook spammer. Spammer Features Fast message spamming. Controllable speed. Noob friendly. Usage N

Varient 2 Apr 22, 2022
A Python package that can be used to download post and comment data from Reddit.

Reddit Data Collector Reddit Data Collector is a Python package that allows a user to collect post and comment data from Reddit. It is built on top of

Nico Van den Hooff 3 Jul 26, 2022
A Pancakeswap v2 trading client (and bot) with limit orders, stop-loss, custom gas strategies, a GUI and much more.

Pancakeswap v2 trading client A Pancakeswap trading client (and bot) with limit orders, stop-loss, custom gas strategies, a GUI and much more. If you

571 Mar 15, 2022
Nasdaq Cloud Data Service (NCDS) provides a modern and efficient method of delivery for realtime exchange data and other financial information. This repository provides an SDK for developing applications to access the NCDS.

Nasdaq Cloud Data Service (NCDS) Nasdaq Cloud Data Service (NCDS) provides a modern and efficient method of delivery for realtime exchange data and ot

Nasdaq 8 Dec 01, 2022
Eclipse-grabber - Generate Discord Token Grabbers for both Windows and MacOS

Eclipse Grabber Eclipse Discord Token Grabber What is Eclipse? Eclipse is an ope

Dimitris Kalopisis 117 Dec 23, 2022
A Telegram Calculator to calculate your maths sums

CalculatorBot A Telegram Calculator to calculate your maths sums! Made by /Team

TeamOctave 2 Dec 31, 2021
A Discord bot that rewards players in Minecraft for sending messages on Discord

MCRewards-Discord-Bot A Discord bot that rewards players in Minecraft for sending messages on Discord How to setup: Download this git as a .zip, or cl

3 Dec 26, 2021
Bot para automatizacao de registros no Vacivida para o COVID19

VACIBOT v.06 - Bot para automatizacao de registros no Vacivida para o COVID19 by Victor Fragoso - Prefeitura Municipal de Santo Andrรฉ Email:

Prefeitura de Santo Andrรฉ 22 Sep 19, 2022
Trading through Binance's API using Python & sqlite

pycrypt Automate trading crypto using Python to pull data from Binance's API and analyse trends. May or may not consistently lose money but oh well it

Maxim 4 Sep 02, 2022
This is a Innexia Chat Bot Open Source Code ๐Ÿคฌ

โšก Innexia โšก A Powerful, Smart And Simple Chat Bot ... Written with Python... Available on Telegram as @InnexiaChatBot โค๏ธ Support โญ๏ธ Thanks to everyone

Dark Cyber 4 Oct 02, 2022
GitHub Usage Report

github-analytics from github_analytics import analyze pr_analysis = analyze.PRAnalyzer( "organization/repo", "organization", "team-name",

Shrivu Shankar 1 Oct 26, 2021
A basic Ubisoft API wrapper created in python.

UbisoftAPI A basic Ubisoft API wrapper created in python. I will be updating this with more endpoints as time goes on. Please note that this is my fir

Ethan 2 Oct 31, 2021
eBay Scraper Homework 3 With Python

eBay Scraper Homework 3 Description of Code My ebay-dl.py file is programmed with python to download 6 key pieces of information - name, if there are

1 Nov 10, 2021
Barbot is a discord bot made from discord.py and python, barbot is most to fun and roleplay for servers!

BarBot Main source of barbot Overview Barbot is a discord bot made from discord.py and python, barbot is most to fun and roleplay for servers! Links i

AlexyDaCoder 3 Nov 28, 2021
A virus/stealer made in py

python-virus A virus/stealer made in py. Features: Discord token stealer, Password stealer, Windows key stealer, Credit-card stealer, Image grab, Anti

SKYNETMARCI 5 Dec 12, 2022