Skip to main content

Easy conversation handler for pyrogram mtproto library {for bots only}

Project description

Pyrogram-Conversation {only for bots}

Conversation in pyrogram

from pyrocon import pyrocon

#await pyrocon.ask(c,msg,ask,timeout,stop_cmd,placeholder)

c : "Client" required parameter ( Pyrogram Client )

msg : "Message" request parameter (Msg where to start conv..)

ask : "str" required parameter (Question to ask)

timeout : "int" optional parameter (default to 30 sec)

stop_cmd : "str" optional parameter (default to /cancel)

placeholder : "str" optional parameter (custom placeholder for Forcereply)

#using example:

  from pyrocon import pyrocon

  answer = await pyrocon.ask(c,msg,ask)
  if answer.text:
    print(answer.text)
  answer.reply("I got answer..")

#Handle any kind of errors

  from pyrocon import pyrocon

  answer = await pyrocon.ask(c,msg,ask)
  if answer.error:
    print(answer.error)

#Handle timeout Errors

  from pyrocon import pyrocon

  answer = await pyrocon.ask(c,msg,ask)
  if answer.timeout:
    print(answer.timeout)

#Handle cancellation Errors

  from pyrocon import pyrocon

  answer = await pyrocon.ask(c,msg,ask)
  if answer.cancel:
    print(answer.cancel)

Facts:

#if successful answer is Message object otherwise an error

#answer must be in reply to orginal message and should be a text message otherwise message will be ignored

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

pyrocon-1.0.3.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrocon-1.0.3-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file pyrocon-1.0.3.tar.gz.

File metadata

  • Download URL: pyrocon-1.0.3.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for pyrocon-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b59ddbd26fd903a080b45a3211d670d715a8abbf3b72fe0611498ea9a9303d70
MD5 ff08f91b4ba812b9c58945d3ee73a87c
BLAKE2b-256 ff47ce55fa02d09ea63b8965157e8f3147571d4a67e59054348e7a8b1a11a2b5

See more details on using hashes here.

File details

Details for the file pyrocon-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyrocon-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for pyrocon-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5396c2ff9e36ea032dc038337ff36cef159c10bc1afe74f6e12f2489f7b38e6b
MD5 db86e6d8438b58398043fca65d5f412d
BLAKE2b-256 1da05d12421490134c95a3ff9a5ef8c67e99f967185c7f35848f1d3a857a4abb

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