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 quiz

#await quiz.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 quiz

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

#Handle any kind of errors

  from pyrocon import quiz

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

#Handle timeout Errors

  from pyrocon import quiz

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

#Handle cancellation Errors

  from pyrocon import quiz

  answer = await quiz.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.4.tar.gz (2.9 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.4-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyrocon-1.0.4.tar.gz
  • Upload date:
  • Size: 2.9 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.4.tar.gz
Algorithm Hash digest
SHA256 589529b4a32388fbcc60b2651c11db0ef6656f5946582f4347d52ab42456baec
MD5 533befec21c14f5f6893a3c8e9bce3d9
BLAKE2b-256 071a671483171daa0eb6b19ebc265ad81021c67e2657edf282ed7a13c7fcf2c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrocon-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cc949559d39c8586b5bb151c20c26395c25d5896ee0a2eca5c37d2aeebf63691
MD5 9e979ad8affde38cbc3a7d3a46ab4cec
BLAKE2b-256 4b7bbc5819833b9b6c7ea7af2a65443610dcf4f32d1663a835b464013b19c667

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