pyrocon


Namepyrocon JSON
Version 2.0.5 PyPI version JSON
download
home_pagehttps://github.com/Surendra9123/Pyrocon
SummaryEasy conversation handler for pyrogram mtproto library...
upload_time2023-03-18 12:30:38
maintainer
docs_urlNone
authorSPiDER
requires_python
licenseBSD
keywords example documentation tutorial
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #Conversation in pyrogram 

```from pyrocon import patch```

 **patch(client, clear, timeout, stop_cmd, placeholder)**


__client__ : 'Client' required parameter ( Pyrogram Client )

__clear__ : 'bool' required parameter set true if you want delete msg after get answer(Default to False)

__timeout__ : 'int' optional parameter (Default to 30 sec)

__stop_cmd__ : 'str' optional parameter (Default to __/cancel__)

__placeholder__ : 'str' optional parameter (Custom placeholder for Forcereply)


============================================================


 **patch.ask(update, text, cquery, filter)**


__update__ : 'Message/CallbacQuery' required parameter (Where to start conv..)

__text__ : 'str' Required parameter (Question to ask)

__cquery__ : 'bool' Parameter set True when asking with inline buttons (Default to __False__)

__filter__ : Pyrogram filters optional parameter (Default to __filters.text__)


============================================================


#**using example:**

#**Create quiz instance**
```
  from pyrocon import patch
  from pyrogram import Client,filters
  
  app = Client(...)
  quiz = patch(app)

  @app.on_message(..)  
  async def _(client,message):
    answer = await quiz.ask(message,text)
    if answer.text:
     print(answer.text)
    await answer.reply("I got answer..")

  app.run()
```


#**handle text messages**

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

#**handle CallbackQuery / inline buttons**

```
  answer = await quiz.ask(CallbacQuery,text,cquery=True)
  if answer.text:
    print(answer.text)
  await answer.reply("I got answer..")
  ```

#**Using pyrogram filters**

 __single filter__ 

```
  from pyrogram import filters

  answer = await quiz.ask(update,text,filter=filters.photo)
  print(answer.photo)

  ```
 __multiple filters (same as pyrogram)__

```
  from pyrogram import filters

  answer = await quiz.ask(update,text,filter=(filters.photo & filters.group))
  print(answer.photo)

  ```


#**Handle any kind of errors**

```
  answer = await quiz.ask(update,text)
  if answer.error:
    print(answer.error)
  ```

#**Handle timeout Errors**

```
  answer = await quiz.ask(update,text)
  if answer.timeout:
    print(answer.timeout)
  ```

#**Handle cancellation Errors**

```
  answer = await quiz.ask(update,text)
  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 


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Surendra9123/Pyrocon",
    "name": "pyrocon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "example documentation tutorial",
    "author": "SPiDER",
    "author_email": "mindajitendra63@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4b/b1/8f7bdaf03de2b66064df6d240c91ac1403cc504e5c21e4f97e423463d490/pyrocon-2.0.5.tar.gz",
    "platform": null,
    "description": "#Conversation in pyrogram \n\n```from pyrocon import patch```\n\n **patch(client, clear, timeout, stop_cmd, placeholder)**\n\n\n__client__ : 'Client' required parameter ( Pyrogram Client )\n\n__clear__ : 'bool' required parameter set true if you want delete msg after get answer(Default to False)\n\n__timeout__ : 'int' optional parameter (Default to 30 sec)\n\n__stop_cmd__ : 'str' optional parameter (Default to __/cancel__)\n\n__placeholder__ : 'str' optional parameter (Custom placeholder for Forcereply)\n\n\n============================================================\n\n\n **patch.ask(update, text, cquery, filter)**\n\n\n__update__ : 'Message/CallbacQuery' required parameter (Where to start conv..)\n\n__text__ : 'str' Required parameter (Question to ask)\n\n__cquery__ : 'bool' Parameter set True when asking with inline buttons (Default to __False__)\n\n__filter__ : Pyrogram filters optional parameter (Default to __filters.text__)\n\n\n============================================================\n\n\n#**using example:**\n\n#**Create quiz instance**\n```\n  from pyrocon import patch\n  from pyrogram import Client,filters\n  \n  app = Client(...)\n  quiz = patch(app)\n\n  @app.on_message(..)  \n  async def _(client,message):\n    answer = await quiz.ask(message,text)\n    if answer.text:\n     print(answer.text)\n    await answer.reply(\"I got answer..\")\n\n  app.run()\n```\n\n\n#**handle text messages**\n\n```\n  answer = await quiz.ask(message,text)\n  if answer.text:\n    print(answer.text)\n  await answer.reply(\"I got answer..\")\n  ```\n\n#**handle CallbackQuery / inline buttons**\n\n```\n  answer = await quiz.ask(CallbacQuery,text,cquery=True)\n  if answer.text:\n    print(answer.text)\n  await answer.reply(\"I got answer..\")\n  ```\n\n#**Using pyrogram filters**\n\n __single filter__ \n\n```\n  from pyrogram import filters\n\n  answer = await quiz.ask(update,text,filter=filters.photo)\n  print(answer.photo)\n\n  ```\n __multiple filters (same as pyrogram)__\n\n```\n  from pyrogram import filters\n\n  answer = await quiz.ask(update,text,filter=(filters.photo & filters.group))\n  print(answer.photo)\n\n  ```\n\n\n#**Handle any kind of errors**\n\n```\n  answer = await quiz.ask(update,text)\n  if answer.error:\n    print(answer.error)\n  ```\n\n#**Handle timeout Errors**\n\n```\n  answer = await quiz.ask(update,text)\n  if answer.timeout:\n    print(answer.timeout)\n  ```\n\n#**Handle cancellation Errors**\n\n```\n  answer = await quiz.ask(update,text)\n  if answer.cancel:\n    print(answer.cancel)\n  ```\n\nFacts:\n\n#if successful answer is Message object otherwise an error\n\n#answer must be in reply to orginal message and should be a text message otherwise message will be ignored \n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Easy conversation handler for pyrogram mtproto library...",
    "version": "2.0.5",
    "split_keywords": [
        "example",
        "documentation",
        "tutorial"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6f6bcf0bce57c1443583733704eae9691e5ed657d858458c1a11847ec21ed927",
                "md5": "a2ae156603f1419b7155149ac0a6261b",
                "sha256": "1709d7eca56bc6e47f48f36049407e0ea9d0dfa99ed57adf827e5e167238c553"
            },
            "downloads": -1,
            "filename": "pyrocon-2.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a2ae156603f1419b7155149ac0a6261b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4109,
            "upload_time": "2023-03-18T12:30:36",
            "upload_time_iso_8601": "2023-03-18T12:30:36.671906Z",
            "url": "https://files.pythonhosted.org/packages/6f/6b/cf0bce57c1443583733704eae9691e5ed657d858458c1a11847ec21ed927/pyrocon-2.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4bb18f7bdaf03de2b66064df6d240c91ac1403cc504e5c21e4f97e423463d490",
                "md5": "72396871d29eca33d5e9a27bb6e61cf3",
                "sha256": "adb4f924e07359031c6586ade1e193a7590381d35cd5be5f2cb6a819202aa69a"
            },
            "downloads": -1,
            "filename": "pyrocon-2.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "72396871d29eca33d5e9a27bb6e61cf3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4093,
            "upload_time": "2023-03-18T12:30:38",
            "upload_time_iso_8601": "2023-03-18T12:30:38.736557Z",
            "url": "https://files.pythonhosted.org/packages/4b/b1/8f7bdaf03de2b66064df6d240c91ac1403cc504e5c21e4f97e423463d490/pyrocon-2.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-18 12:30:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Surendra9123",
    "github_project": "Pyrocon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyrocon"
}
        
Elapsed time: 0.15912s