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.5.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.5-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyrocon-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 20d9c27806bb19cc0b373b1021d8caedfe0a4234e546f3be0d619a76f72c702b
MD5 37a19db21900929a86624c32b4c34787
BLAKE2b-256 7b7a39777a95f613f6e2f2a5d807572c9959c4d020af2c60ab45b04da02ac83d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrocon-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.0 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3d7701adc3d709bd48f4041e7911692af5a9834ad98f20ed9aa404e443f988d9
MD5 e822d83bfc898fb764a97c408b0b012e
BLAKE2b-256 ed06bc28f9b53fa0b952ca3dd8c5bc8d5f520562dcd5ac03a3e6907a410eb2ef

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