A python package for creating Twitch Bots
Project description
#Jarvis
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()
##Custom Commands
You can create your own custom commands and interactions for your bot using the Jarvis Core.
Create a folder called Commands
in the same location as your bot file like so,
+-- root
| |-- bot.py
| +-- Commands
| |-- command1.py
| +-- command2.py
Then, copy the following boiler plate text to get started. This example implements a simple ping command.
Note: All Commands need to implement setup()
and teardown()
, both take channel as a parameter.
from jarviscore.command import Command
from jarviscore.message import CommandMessage
from jarviscore.log import Log
log = Log("CORE:Ping", verbose="log")
class Ping(Command):
def __init__(self, channel):
Command.__init__(self, "Ping")
self.channel = channel
def on_command(self, data: CommandMessage):
if "ping" == data.KEYWORD:
self.channel.socket.send_message(data.channel, "pong")
def setup(channel):
channel.load_command(Ping(channel))
log.log(f"[{channel.name}]: Loaded Module Ping")
def teardown(channel):
log.log(f"[{channel.name}]: Removed Module Ping")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jarviscore-0.1.1.17.tar.gz
(18.0 kB
view hashes)
Built Distribution
Close
Hashes for jarviscore-0.1.1.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88237cf02f151d8c2943cad916eab71e1260bab8dd19919b659567cd60f59e0e |
|
MD5 | 49b2f8d4c5e4ba5d6fa10cf03dc02190 |
|
BLAKE2b-256 | 5be5bf522745b09391be8ee2113ef29dfa852ead112da1088acbc5644c8a1098 |