Skip to main content

Comments.bot

PyPI Supported Python Versions Downloads

A simple API wrapper to interact with comments.bot api.

Installation

The latest version of comments.bot is available via pip:

pip install --upgrade comments.bot

Also, you can download the source code and install using:

poetry install

Note: You need to have poetry installed on your system

Usage

The library can be used in both Sync and Async! For both there are 2 client which can be imported from comments_bot - SyncClient, AsyncClient.

from comments_bot import SyncClient, AsyncClient
from asyncio import run

asyncClient = AsyncClient(api_key="some api key", owner_id=12345678)  # Async Client
syncClient = SyncClient(api_key="some api key", owner_id=12345678)  # Sync Client

# Both of the clients have same function - createPost, editPost, deletePost
post_text_id, link_text = syncClient.createPost(text="hey")  # Post a text message
post_photo_id, link_photo = syncClient.createPost(type="photo", photo_url="some url", caption="some text for caption")  # Post a photo

status, post_text_id = syncClient.editPost(post_id=post_text_id, text="some other message")

status = syncClient.deletePost(post_id=post_id)  # Deletes the post from comments.bot

You can use the below methods for both SyncClient and AsyncClient.

Methods Available:

createPost() arguments:

  • owner_id:

    • required if not passed on Client.
  • type:

    • must be text or photo. text is used by default if not specified.
  • text:

    • required if type equals to text. It must be a string betwen 0-4056 characters.
  • photo_url:

    • required if type equals to photo. It must be a string containing a link to the image.
  • caption:

    • Caption for the image. Only valid for photo type.
  • parse_mode:

    • Parse mode for the text/caption. It must be markdown or html.
  • administrators:

    • A string with user_ids (numbers) separated by comma. Example: 123456789,987654321,012345678.
  • disable_notifications:

    • Pass True if you don't want to receive notifications about new comments for your post.

editPost() arguments:

  • type:

    • must be text or photo. text is used by default if not specified.
  • text:

    • required if type equals to text. It must be a string betwen 0-4056 characters.
  • photo_url:

    • required if type equals to photo. It must be a string containing a link to the image.
  • caption:

    • Caption for the image. Only valid for photo type.
  • parse_mode:

    • Parse mode for the text/caption. It must be markdown or html.

deletePost() arguments:

  • post_id:
    • Pass the post id to be deleted

Contribuiting

Wanna help and improve this project?

Make sure to follow these before opening a PR:

  • Make sure your PR passes the test and is formatted according to pre-commit.
  • Make sure the package is working without any issues!

License

This project is licensed under the MIT License - see the LICENSE file for details

Metadata

Release files for comments.bot 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for comments.bot 1.0.0
File Size Uploaded Provenance Actions
comments.bot-1.0.0.tar.gz 5.0 kB Without provenance Details for comments.bot-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for comments.bot 1.0.0
File Interpreter ABI Platform Actions
comments.bot-1.0.0-py3-none-any.whl Python 3 none any Details for comments.bot-1.0.0-py3-none-any.whl

Total release size: 11.6 kB

Release files / comments.bot-1.0.0.tar.gz

Download URL comments.bot-1.0.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4debf8e1ac1d5da447ca5fc41eb6e8afe012038b680d03c1430ebc54fc9e0564
BLAKE2b-256 checksum
How to use checksums
47ee2282e050007e51c9b0516e5c9b4b3664953d89ede8277971b6f0be628021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.9.6 Windows/10

Release files / comments.bot-1.0.0-py3-none-any.whl

Download URL comments.bot-1.0.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f3a7185a37ec3d44ae26977d1ce7cbbae5b6cebcf07e0a055d785bf4f03aeb3
BLAKE2b-256 checksum
How to use checksums
f3c52a3c5916a1e447cd79eb019b96c9d23531a44b02f24724691bb35bf39cc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.9.6 Windows/10

Security for comments.bot 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page