disunity


Namedisunity JSON
Version 0.1.17 PyPI version JSON
download
home_pageNone
SummaryPython framework for Discord interactions using a web server
upload_time2024-09-08 09:30:29
maintainerNone
docs_urlNone
authorTadeo Murillo,
requires_python>=3.10.0
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # disunity

Python framework for Discord interactions using a web server

# Installation
`pip install disunity`

# Introduction to Disunity
```python
import disunity

server = disunity.DisunityServer()

if __name__ == '__main__':
    server.run()
```

Using packages
```python
import disunity
import pathlib

server = disunity.DisunityServer()

@server.before_serving
def load_packages():
    for package in [f"{f.parent}.{f.stem}" for f in pathlib.Path("packages").glob("*.py")]:
        server.load_package(package)

if __name__ == '__main__':
    server.run()

```

# Setting up a package

```python
from disunity import package, utils

class FirstPackage(package.Package):
    def __init__(self, app):
        self.app = app

    @package.Package.command('ping')
    async def ping(self, ctx):
        return await ctx.callback("Pong!")

def setup(app):
    app.register_package(FirstPackage(app))

```

# Disclaimer

This will require that you already have hosting service for the server to run on as well as a domain to host the server on. If you have neither of these, an alternative would be to host on Heroku using a web application with Gunicorn. 

# Side note

The server will receive interactions to the `/interactions` endpoint of your server. It will look like this: `https://example.com/interactions`. Once you run the server, put the url with the added interactions endpoint into the `interactions` URL on your app located in the Discord developer portal.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "disunity",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10.0",
    "maintainer_email": null,
    "keywords": null,
    "author": "Tadeo Murillo,",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/af/2c/4c91034428e6efcf64bf86eeed1b75b586ae9a30074e63ff15ff69a86a9e/disunity-0.1.17.tar.gz",
    "platform": null,
    "description": "# disunity\r\n\r\nPython framework for Discord interactions using a web server\r\n\r\n# Installation\r\n`pip install disunity`\r\n\r\n# Introduction to Disunity\r\n```python\r\nimport disunity\r\n\r\nserver = disunity.DisunityServer()\r\n\r\nif __name__ == '__main__':\r\n    server.run()\r\n```\r\n\r\nUsing packages\r\n```python\r\nimport disunity\r\nimport pathlib\r\n\r\nserver = disunity.DisunityServer()\r\n\r\n@server.before_serving\r\ndef load_packages():\r\n    for package in [f\"{f.parent}.{f.stem}\" for f in pathlib.Path(\"packages\").glob(\"*.py\")]:\r\n        server.load_package(package)\r\n\r\nif __name__ == '__main__':\r\n    server.run()\r\n\r\n```\r\n\r\n# Setting up a package\r\n\r\n```python\r\nfrom disunity import package, utils\r\n\r\nclass FirstPackage(package.Package):\r\n    def __init__(self, app):\r\n        self.app = app\r\n\r\n    @package.Package.command('ping')\r\n    async def ping(self, ctx):\r\n        return await ctx.callback(\"Pong!\")\r\n\r\ndef setup(app):\r\n    app.register_package(FirstPackage(app))\r\n\r\n```\r\n\r\n# Disclaimer\r\n\r\nThis will require that you already have hosting service for the server to run on as well as a domain to host the server on. If you have neither of these, an alternative would be to host on Heroku using a web application with Gunicorn. \r\n\r\n# Side note\r\n\r\nThe server will receive interactions to the `/interactions` endpoint of your server. It will look like this: `https://example.com/interactions`. Once you run the server, put the url with the added interactions endpoint into the `interactions` URL on your app located in the Discord developer portal.\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python framework for Discord interactions using a web server",
    "version": "0.1.17",
    "project_urls": {
        "Bug Tracker": "https://github.com/murillotadeo/disunity/issues",
        "Homepoge": "https://github.com/murillotadeo/disunity"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "492b6fefdecf591919db94820a5f77e1aa7e6727493e9b3dc1ae9032144207ec",
                "md5": "34fd10be354387a86c9fd7a031020053",
                "sha256": "edb1798d5afe6c0caaca1b40667918be4344d76b15072d3a11600b9121370468"
            },
            "downloads": -1,
            "filename": "disunity-0.1.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "34fd10be354387a86c9fd7a031020053",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10.0",
            "size": 18929,
            "upload_time": "2024-09-08T09:30:27",
            "upload_time_iso_8601": "2024-09-08T09:30:27.314746Z",
            "url": "https://files.pythonhosted.org/packages/49/2b/6fefdecf591919db94820a5f77e1aa7e6727493e9b3dc1ae9032144207ec/disunity-0.1.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "af2c4c91034428e6efcf64bf86eeed1b75b586ae9a30074e63ff15ff69a86a9e",
                "md5": "ecf24d33bceba41977b016b78f95134f",
                "sha256": "c58619404851e572d81769e55d620a067a647e4836adec5401c5b4e00caa8dc3"
            },
            "downloads": -1,
            "filename": "disunity-0.1.17.tar.gz",
            "has_sig": false,
            "md5_digest": "ecf24d33bceba41977b016b78f95134f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10.0",
            "size": 15337,
            "upload_time": "2024-09-08T09:30:29",
            "upload_time_iso_8601": "2024-09-08T09:30:29.214665Z",
            "url": "https://files.pythonhosted.org/packages/af/2c/4c91034428e6efcf64bf86eeed1b75b586ae9a30074e63ff15ff69a86a9e/disunity-0.1.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-08 09:30:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "murillotadeo",
    "github_project": "disunity",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "disunity"
}
        
Elapsed time: 0.39578s