dgg-bot


Namedgg-bot JSON
Version 1.8.0 PyPI version JSON
download
home_pageNone
SummaryA library for connecting to and making a bot in Destiny.gg chat.
upload_time2024-08-05 07:39:51
maintainerNone
docs_urlNone
authorFritz-02
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            DGG-bot
=======

.. image:: https://img.shields.io/pypi/l/dgg-bot.svg
   :target: https://pypi.python.org/pypi/dgg-bot
   :alt: PyPI license info
.. image:: https://img.shields.io/pypi/v/dgg-bot.svg
   :target: https://pypi.python.org/pypi/dgg-bot
   :alt: PyPI version info
.. image:: https://img.shields.io/pypi/pyversions/dgg-bot.svg
   :target: https://pypi.python.org/pypi/dgg-bot
   :alt: PyPI supported Python versions

A library for connecting to and making a bot in Destiny.gg chat.

Installing
----------

**Python 3.9 or higher is required** (version 0.5.0 and above, Python 3.8+ for versions below)

.. code:: sh

    # Linux/macOS
    python3 -m pip install -U dgg-bot

    # Windows
    py -3 -m pip install -U dgg-bot


Usage
-----

Not sure what to put here at this point in time. Unauthorized chat bots are subject to being **banned**, ask Cake in DGG for permission and guidelines for chat bots before running one.


Examples
--------

A simple bot with three commands and will yump back at chatters.

.. code-block:: python

    from dggbot import DGGBot
    import time

    bot = DGGBot(
        "AUTH_TOKEN",
        owner="Owner",
        prefix="$",
    )  # default command prefix is "!"

    @bot.command()
    @bot.is_owner()  # only the owner named in DGGBot can use this command.
    def test(msg):  # $test
        msg.reply("Test 123")

    @bot.command(aliases=["banmeplease"])  # aliases for this command
    def banme(msg):  # $banme / $banmeplease
        bot.send("RightToBearArmsLOL BINGQILIN nathanTiny2")


    def is_cake(msg):  # a check where only the user Cake can use commands with this check
        return msg.nick == "Cake"

    @bot.command(aliases=["oooo"])
    @bot.check(is_cake)
    def pog(msg):
        msg.reply("Cake OOOO")

    """
    Events
    You can either name the function after the event, or include the event name in the decorator.
    mention() is also included as a shortcut for event("on_mention").

    Event names: on_ban, on_broadcast, on_join, on_mention, on_msg, on_mute, on_privmsg, on_quit,
                 on_refresh, on_unban
    """

    @bot.event()
    def on_msg(msg):
        print(msg)

    # @bot.event("on_mention")
    @bot.mention()
    def yump(msg):
        if "MiyanoHype" in msg.data:
            time.sleep(0.5)
            msg.reply(f"{msg.nick} MiyanoHype")

    if __name__ == "__main__":
        bot.run_forever()


Connecting to alternative DGG environments.

.. code-block:: python

    from dggbot import DGGBot

    bot = DGGBot(
        owner="Owner",
        prefix="$",
        sid="SID",
        rememberme="REMEMBERME",
        config={
            {
                "wss": "wss://chat.omniliberal.dev/ws",
                "wss-origin": "https://www.omniliberal.dev",
                "baseurl": "https://www.omniliberal.dev",
                "endpoints": {"user": "/api/chat/me", "userinfo": "/api/userinfo"},
                "flairs": "https://cdn.omniliberal.dev/flairs/flairs.json",
            }
        },
    )

    @bot.event()
    def on_msg(msg):
        print(msg)

    if __name__ == "__main__":
        bot.run_forever()

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dgg-bot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Fritz-02",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/79/53/cdbb7db98a155b3153eb27ff35087a82d0bad331477272439f7f228954a1/dgg_bot-1.8.0.tar.gz",
    "platform": null,
    "description": "DGG-bot\r\n=======\r\n\r\n.. image:: https://img.shields.io/pypi/l/dgg-bot.svg\r\n   :target: https://pypi.python.org/pypi/dgg-bot\r\n   :alt: PyPI license info\r\n.. image:: https://img.shields.io/pypi/v/dgg-bot.svg\r\n   :target: https://pypi.python.org/pypi/dgg-bot\r\n   :alt: PyPI version info\r\n.. image:: https://img.shields.io/pypi/pyversions/dgg-bot.svg\r\n   :target: https://pypi.python.org/pypi/dgg-bot\r\n   :alt: PyPI supported Python versions\r\n\r\nA library for connecting to and making a bot in Destiny.gg chat.\r\n\r\nInstalling\r\n----------\r\n\r\n**Python 3.9 or higher is required** (version 0.5.0 and above, Python 3.8+ for versions below)\r\n\r\n.. code:: sh\r\n\r\n    # Linux/macOS\r\n    python3 -m pip install -U dgg-bot\r\n\r\n    # Windows\r\n    py -3 -m pip install -U dgg-bot\r\n\r\n\r\nUsage\r\n-----\r\n\r\nNot sure what to put here at this point in time. Unauthorized chat bots are subject to being **banned**, ask Cake in DGG for permission and guidelines for chat bots before running one.\r\n\r\n\r\nExamples\r\n--------\r\n\r\nA simple bot with three commands and will yump back at chatters.\r\n\r\n.. code-block:: python\r\n\r\n    from dggbot import DGGBot\r\n    import time\r\n\r\n    bot = DGGBot(\r\n        \"AUTH_TOKEN\",\r\n        owner=\"Owner\",\r\n        prefix=\"$\",\r\n    )  # default command prefix is \"!\"\r\n\r\n    @bot.command()\r\n    @bot.is_owner()  # only the owner named in DGGBot can use this command.\r\n    def test(msg):  # $test\r\n        msg.reply(\"Test 123\")\r\n\r\n    @bot.command(aliases=[\"banmeplease\"])  # aliases for this command\r\n    def banme(msg):  # $banme / $banmeplease\r\n        bot.send(\"RightToBearArmsLOL BINGQILIN nathanTiny2\")\r\n\r\n\r\n    def is_cake(msg):  # a check where only the user Cake can use commands with this check\r\n        return msg.nick == \"Cake\"\r\n\r\n    @bot.command(aliases=[\"oooo\"])\r\n    @bot.check(is_cake)\r\n    def pog(msg):\r\n        msg.reply(\"Cake OOOO\")\r\n\r\n    \"\"\"\r\n    Events\r\n    You can either name the function after the event, or include the event name in the decorator.\r\n    mention() is also included as a shortcut for event(\"on_mention\").\r\n\r\n    Event names: on_ban, on_broadcast, on_join, on_mention, on_msg, on_mute, on_privmsg, on_quit,\r\n                 on_refresh, on_unban\r\n    \"\"\"\r\n\r\n    @bot.event()\r\n    def on_msg(msg):\r\n        print(msg)\r\n\r\n    # @bot.event(\"on_mention\")\r\n    @bot.mention()\r\n    def yump(msg):\r\n        if \"MiyanoHype\" in msg.data:\r\n            time.sleep(0.5)\r\n            msg.reply(f\"{msg.nick} MiyanoHype\")\r\n\r\n    if __name__ == \"__main__\":\r\n        bot.run_forever()\r\n\r\n\r\nConnecting to alternative DGG environments.\r\n\r\n.. code-block:: python\r\n\r\n    from dggbot import DGGBot\r\n\r\n    bot = DGGBot(\r\n        owner=\"Owner\",\r\n        prefix=\"$\",\r\n        sid=\"SID\",\r\n        rememberme=\"REMEMBERME\",\r\n        config={\r\n            {\r\n                \"wss\": \"wss://chat.omniliberal.dev/ws\",\r\n                \"wss-origin\": \"https://www.omniliberal.dev\",\r\n                \"baseurl\": \"https://www.omniliberal.dev\",\r\n                \"endpoints\": {\"user\": \"/api/chat/me\", \"userinfo\": \"/api/userinfo\"},\r\n                \"flairs\": \"https://cdn.omniliberal.dev/flairs/flairs.json\",\r\n            }\r\n        },\r\n    )\r\n\r\n    @bot.event()\r\n    def on_msg(msg):\r\n        print(msg)\r\n\r\n    if __name__ == \"__main__\":\r\n        bot.run_forever()\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library for connecting to and making a bot in Destiny.gg chat.",
    "version": "1.8.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Fritz-02/dgg-bot/issues",
        "Homepage": "https://github.com/Fritz-02/dgg-bot/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "596865dedc6f5bf1214a84af08a1259060569e3a0accc6f1c45cce1e168823de",
                "md5": "e1693596773cd95c551a71a9f85d0057",
                "sha256": "fc88dc714a6c6ff8725adb8729a09a7a03eb3e8d1ec527b0a8eac320e05dde35"
            },
            "downloads": -1,
            "filename": "dgg_bot-1.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e1693596773cd95c551a71a9f85d0057",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 14682,
            "upload_time": "2024-08-05T07:39:48",
            "upload_time_iso_8601": "2024-08-05T07:39:48.958751Z",
            "url": "https://files.pythonhosted.org/packages/59/68/65dedc6f5bf1214a84af08a1259060569e3a0accc6f1c45cce1e168823de/dgg_bot-1.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7953cdbb7db98a155b3153eb27ff35087a82d0bad331477272439f7f228954a1",
                "md5": "f81f12c4aadb315357cc670a06aa053a",
                "sha256": "2703d27b886ef6d0f28a1e471afb5560cdac2f51d9e6351e81cc6ffd6802b56d"
            },
            "downloads": -1,
            "filename": "dgg_bot-1.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f81f12c4aadb315357cc670a06aa053a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 12101,
            "upload_time": "2024-08-05T07:39:51",
            "upload_time_iso_8601": "2024-08-05T07:39:51.563777Z",
            "url": "https://files.pythonhosted.org/packages/79/53/cdbb7db98a155b3153eb27ff35087a82d0bad331477272439f7f228954a1/dgg_bot-1.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-05 07:39:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Fritz-02",
    "github_project": "dgg-bot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "dgg-bot"
}
        
Elapsed time: 0.29752s