django-oscarbot


Namedjango-oscarbot JSON
Version 0.28 PyPI version JSON
download
home_pagehttps://oscarbot.site/
SummaryDjango app for create Telegram bot
upload_time2024-04-10 12:54:58
maintainerNone
docs_urlNone
authorOleg Maslov
requires_python>=3.8
licenseCopyright (c) 2023 Oleg Maslov (https://oscar-studio.com/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords django telegram
VCS
bugtrack_url
requirements asgiref certifi charset-normalizer Django idna psycopg2-binary python-dotenv pytz requests sqlparse urllib3
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TG Core from Oscar
> Telegram bot core only for webhooks way working

Telegram bot core, created in django style with routing and views(handlers) where you
can use included builders for menu or messages 

## Installing / Getting started

This is package only for using with Django project.

```shell
pip install django-oscarbot
```

### Initial Configuration

In settings.py file you need to specify application for tg use:
```python
OSCARBOT_APPS = ['main']

# set Telegram api url in your env variables TELEGRAM_URL
# set Telegram message parse mode:
TELEGRAM_PARSE_MODE = 'HTML'
# or
TELEGRAM_PARSE_MODE = 'MARKDOWN'
```
Run django server and open [localhost:8000/admin/](http://localhost:8000/admin/) and create new bot, 
at least fill bot token for testing ability
## Features
* User model
```python

from oscarbot.models import User

some_user = User.objects.filter(username='@maslov_oa').first()

```

* Menu and Buttons builder
```python
from oscarbot.menu import Menu, Button


button_list = [
    Button(text='Text for callback', callback='/some_callback/'),
    Button(text='Text for external url', url='https://oscarbot.site/'),
    Button(text='Web app view', web_app='https://oscarbot.site/'),
]

menu = Menu(button_list)

```

* Message builder
```python
from oscarbot.shortcut import QuickBot

quick_bot = QuickBot(
    chat=111111111,
    message='Hello from command line',
    token='token can be saved in DB and not required'
)
quick_bot.send()
```

* Application with routing and views(handlers):

    [example application](https://github.com/oscarbotru/oscarbot/tree/master/example/)

* Long polling server for testing
```shell
python manage.py runbot
```

* Update messages available
```python
# TODO: work in progress
```

* Messages log
```python
# TODO: work in progress
```


## Links

- Project homepage: https://oscarbot.site/
- Repository: https://github.com/oscarbotru/oscarbot/

## Licensing

The code in this project is licensed under MIT license.

            

Raw data

            {
    "_id": null,
    "home_page": "https://oscarbot.site/",
    "name": "django-oscarbot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "django, telegram",
    "author": "Oleg Maslov",
    "author_email": "Oleg Maslov <info@oscar-studio.com>",
    "download_url": "https://files.pythonhosted.org/packages/8f/5a/a04eeb33231754d8db7d3c7df341c6290af6279259a099e803950d57ca6c/django-oscarbot-0.28.tar.gz",
    "platform": null,
    "description": "# TG Core from Oscar\n> Telegram bot core only for webhooks way working\n\nTelegram bot core, created in django style with routing and views(handlers) where you\ncan use included builders for menu or messages \n\n## Installing / Getting started\n\nThis is package only for using with Django project.\n\n```shell\npip install django-oscarbot\n```\n\n### Initial Configuration\n\nIn settings.py file you need to specify application for tg use:\n```python\nOSCARBOT_APPS = ['main']\n\n# set Telegram api url in your env variables TELEGRAM_URL\n# set Telegram message parse mode:\nTELEGRAM_PARSE_MODE = 'HTML'\n# or\nTELEGRAM_PARSE_MODE = 'MARKDOWN'\n```\nRun django server and open [localhost:8000/admin/](http://localhost:8000/admin/) and create new bot, \nat least fill bot token for testing ability\n## Features\n* User model\n```python\n\nfrom oscarbot.models import User\n\nsome_user = User.objects.filter(username='@maslov_oa').first()\n\n```\n\n* Menu and Buttons builder\n```python\nfrom oscarbot.menu import Menu, Button\n\n\nbutton_list = [\n    Button(text='Text for callback', callback='/some_callback/'),\n    Button(text='Text for external url', url='https://oscarbot.site/'),\n    Button(text='Web app view', web_app='https://oscarbot.site/'),\n]\n\nmenu = Menu(button_list)\n\n```\n\n* Message builder\n```python\nfrom oscarbot.shortcut import QuickBot\n\nquick_bot = QuickBot(\n    chat=111111111,\n    message='Hello from command line',\n    token='token can be saved in DB and not required'\n)\nquick_bot.send()\n```\n\n* Application with routing and views(handlers):\n\n    [example application](https://github.com/oscarbotru/oscarbot/tree/master/example/)\n\n* Long polling server for testing\n```shell\npython manage.py runbot\n```\n\n* Update messages available\n```python\n# TODO: work in progress\n```\n\n* Messages log\n```python\n# TODO: work in progress\n```\n\n\n## Links\n\n- Project homepage: https://oscarbot.site/\n- Repository: https://github.com/oscarbotru/oscarbot/\n\n## Licensing\n\nThe code in this project is licensed under MIT license.\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2023 Oleg Maslov (https://oscar-studio.com/)  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Django app for create Telegram bot",
    "version": "0.28",
    "project_urls": {
        "Bug Reports": "https://github.com/oscarbotru/oscarbot/issues",
        "Homepage": "https://github.com/oscarbotru/oscarbot"
    },
    "split_keywords": [
        "django",
        " telegram"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "54dfd5f1b574bf779c1c2d56e4239d35a07d34112633c99437ee1d8f572d1bda",
                "md5": "98a7f3f4a4e56f6bb3ffeedd06e2f1bf",
                "sha256": "649d439865ac02af0ddd7446e9d312f8feef4460ad128e75feb183a2b7dc6d37"
            },
            "downloads": -1,
            "filename": "django_oscarbot-0.28-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "98a7f3f4a4e56f6bb3ffeedd06e2f1bf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 58406,
            "upload_time": "2024-04-10T12:54:56",
            "upload_time_iso_8601": "2024-04-10T12:54:56.399468Z",
            "url": "https://files.pythonhosted.org/packages/54/df/d5f1b574bf779c1c2d56e4239d35a07d34112633c99437ee1d8f572d1bda/django_oscarbot-0.28-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f5aa04eeb33231754d8db7d3c7df341c6290af6279259a099e803950d57ca6c",
                "md5": "8fe76c0c12e544e134ed44c8cc71c26e",
                "sha256": "33b4cce7d4725b54edec6d37eab4e15fb24895b118ac1cbaaf6f053a2c4c6e09"
            },
            "downloads": -1,
            "filename": "django-oscarbot-0.28.tar.gz",
            "has_sig": false,
            "md5_digest": "8fe76c0c12e544e134ed44c8cc71c26e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 39471,
            "upload_time": "2024-04-10T12:54:58",
            "upload_time_iso_8601": "2024-04-10T12:54:58.601493Z",
            "url": "https://files.pythonhosted.org/packages/8f/5a/a04eeb33231754d8db7d3c7df341c6290af6279259a099e803950d57ca6c/django-oscarbot-0.28.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-10 12:54:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oscarbotru",
    "github_project": "oscarbot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "asgiref",
            "specs": [
                [
                    "==",
                    "3.7.2"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2023.7.22"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.3.0"
                ]
            ]
        },
        {
            "name": "Django",
            "specs": [
                [
                    "==",
                    "4.2.6"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.4"
                ]
            ]
        },
        {
            "name": "psycopg2-binary",
            "specs": [
                [
                    "==",
                    "2.9.9"
                ]
            ]
        },
        {
            "name": "python-dotenv",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2023.3.post1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "sqlparse",
            "specs": [
                [
                    "==",
                    "0.4.4"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.0.6"
                ]
            ]
        }
    ],
    "lcname": "django-oscarbot"
}
        
Elapsed time: 0.43188s