Skip to main content

Pure Python interface for Bot API. Bot cookbook for Humans.

Project description

🐍 bot-python

Pure Python interface for Bot API.

Table of contents

Introduction

This library provides complete Bot API 1.0 interface and compatible with Python 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10.

Getting started

  • 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, name=NAME, version=VERSION, api_url_base="https://api.icq.net/bot/v1"), by default we use the domain: https://api.icq.net/bot/v1

  • If you are Myteam client, you can add flag "is_myteam=True", when instantiating the Bot class. This will let you use additional chat methods.

    Example: Bot(token=TOKEN, name=NAME, is_myteam=True), by default it is False.

An example of how to use the framework can be seen in example/test_bot.py

Installing

Install using pip:

pip install --upgrade mailru-im-bot-updated

Install from sources:

git clone https://github.com/Lunatik-cyber/bot-python-icq.git
cd icq_bot-python-icq
python setup.py install

New features

  • Added file_name argument to send_file function. Now you can send files with custom names.
  • Now you can receive sent data in send_text, send_file, send_voice, edit_text functions, answer_callback_query.

Example file_name argument

bot.send_file(chat_id=chat_id, file_name="test.txt", file=open("test.txt", "rb"))

Example sent data

msg = bot.send_text(chat_id=chat_id, text="test")
bot.edit_text(chat_id=chat_id, message_id=msg["msgId"], text="test2")

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

mailru-im-bot-updated-0.0.25.tar.gz (14.3 kB view details)

Uploaded Source

File details

Details for the file mailru-im-bot-updated-0.0.25.tar.gz.

File metadata

  • Download URL: mailru-im-bot-updated-0.0.25.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for mailru-im-bot-updated-0.0.25.tar.gz
Algorithm Hash digest
SHA256 033ccf6fa4b36823a389bfd575b9a07d00a693d2fe8eba64e06e5730aa2812fa
MD5 7dfa3da5370f39cd394ff91f0cabb7ee
BLAKE2b-256 8ac433a43c818143eb3a294ebea7242671484b045c4a30494b3333a1674663c9

See more details on using hashes here.

Supported by

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