Skip to main content

ICQ/VK Teams Bot API interface

Project description

Async ICQ/VK Teams bot API wrapper

PyPi Package Version PyPi Package Status Supported Python versions Package dwn stats License Repo size Author stars count

Pure Async Python interface for Bot API.

Table of contents

Introduction

This library provides complete ICQ/Myteam Bot API 1.0 interface and requires Python 3.5+

Quick start

  • Create your own bot by sending the /newbot command to Metabot and follow the instructions.

    Note: a bot can only reply after the user has added it to his contact list, or if the user was the first to start a dialogue.

  • You can configure the domain that hosts your ICQ server. When instantiating the Bot class, add the address of your domain.

    Example: Bot(token=TOKEN, url="https://api.icq.net"), by default we use the domain: https://api.icq.net (ICQ) or http://myteam.mail.ru (VK Teams)

Installing

Install using pip:

pip install -U async-icq

Install from sources:

git clone https://github.com/dasshit/async-icq.git
cd async-icq
python setup.py install

Examples

Basic example of using this library will look like this

from async_icq.bot import AsyncBot
from async_icq.events import Event

# Creating bot
example = AsyncBot(
  token='TOKEN',
  url='https://api.icq.net',
)


# Adding some basic event handler by decorators (handler must accept 2 arguments: bot and event)
# Diffent decorators will set it up for diffent types of events
@example.message_handler()
async def hello(event: Event):
  
  await event.answer(
    text=f'Hi, {event.from_.userId}'
  )

  await event.log(
    f'Answered to {event.chat.chatId} to {event.from_.userId}')


# Starting to poll new events and sending them to middleware and handlers
example.start_poll()

Example of how to use this library could be found in async-icq/examples

API description

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async_icq-1.3.8.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

async_icq-1.3.8-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file async_icq-1.3.8.tar.gz.

File metadata

  • Download URL: async_icq-1.3.8.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for async_icq-1.3.8.tar.gz
Algorithm Hash digest
SHA256 853d735d98c2fa059a7936821bdafb871d963334351cf031ea746f107c926f0b
MD5 bb2e7b9509fce3d6d16a44c7aa575956
BLAKE2b-256 e9d66332a67eb31774be50b6d35f084641db645469d6a9c097010abb1b2a7ee0

See more details on using hashes here.

File details

Details for the file async_icq-1.3.8-py3-none-any.whl.

File metadata

  • Download URL: async_icq-1.3.8-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for async_icq-1.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4396e74b3d3e85d1ff0d04a572ecfe544f19bc4208681a85530cd0cc77e9398c
MD5 0f12a9d3aef462ee495d3ea16d0d5370
BLAKE2b-256 ba6fdb72b047dec6fa80df45292361f09186fef88713b3a304283131b5e8f541

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page