Skip to main content

Jarvis

Build status PyPI version

This is the repository for Jarvis, the twitch bot.

Getting Started

The simplest way to get started is to create a new file, with the basic code below:

from jarviscore.client import Client

jarvis = Client(nick="yourbotsname", 
    token="yourbotstoken",
    channels=["a list", "of channels", "to connect to"])
jarvis.start()

As an alternative, better practice would be to make use of a config file to store your settings and loading them into the bot when you start.
Use the following code for your bot as a starter.

from jarviscore.client import Client
from jarviscore import Settings

setting = Settings()

jarvis = Client(nick=setting.get_setting("nick"), 
    token=setting.get_setting("token"),
    channels=setting.get_setting("channels"))
jarvis.start()

Next, create a file called config.json and use the following template to get started

{
    "name": "yourbotsname",
    "token": "yourbotstoken",
    "channels": [
        "a list", "of channels", "to connect to"
    ]
}

If you prefer, you may use a config.yaml file instead.

Custom Modules

You can create your own custom modules and interactions for your bot using the Jarvis Core. Create a folder called modules in the same location as your bot file like so,

+-- root
|   |-- bot.py
|   |-- config.json
|   +-- modules
|       |-- module1.py
|       |-- module2.py

Then, copy the following boiler plate text to get started. This example implements a simple ping module.
Note: All modules need to implement setup() and teardown(), both take channel as a parameter.

from jarviscore import Module, Log
from jarviscore import CommandMessage

log = Log("Module:Ping", verbose="log")
class Ping(Module):

    def __init__(self, channel):
        Module.__init__(self, "Ping")
        self.channel = channel

    def on_command(self, data: CommandMessage):
        if "ping" == data.KEYWORD:
            self.channel.send("pong")


def setup(channel):
    channel.load_module(Ping(channel))
    log.log(f"Loaded Module Ping")

def teardown(channel):
    log.log(f"Removed Module Ping")

Metadata

Release files for jarviscore-nightly 0.1.1.203

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jarviscore-nightly 0.1.1.203
File Size Uploaded Provenance Actions
jarviscore-nightly-0.1.1.203.tar.gz 25.7 kB Without provenance Details for jarviscore-nightly-0.1.1.203.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jarviscore-nightly 0.1.1.203
File Interpreter ABI Platform Actions
jarviscore_nightly-0.1.1.203-py3-none-any.whl Python 3 none any Details for jarviscore_nightly-0.1.1.203-py3-none-any.whl

Total release size: 56.8 kB

Release files / jarviscore-nightly-0.1.1.203.tar.gz

Download URL jarviscore-nightly-0.1.1.203.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bc173d044320066ca88ebd1d7ee49e53b7f071e497e1dba432969f0fc7e9d241
BLAKE2b-256 checksum
How to use checksums
99024689e8a069d0f58c82dee117909366280769b7832f33ffa5b0c7e539199e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / jarviscore_nightly-0.1.1.203-py3-none-any.whl

Download URL jarviscore_nightly-0.1.1.203-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b875f417f86176a2557ae27f0d4700a17e84718b76ea21b238f628276f3cb4e
BLAKE2b-256 checksum
How to use checksums
0e11f5dbac8383cdda363eef44e9b1f6c5f115a0980aae01817c1435c8bde30e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Security for jarviscore-nightly 0.1.1.203

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1.203 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page