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 import Command, Log
from jarviscore.message import CommandMessage
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.send("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.24.tar.gz
(18.2 kB
view hashes)
Built Distribution
Close
Hashes for jarviscore-0.1.1.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc17ebecc7d559a102fa16bd408bd42801c8a186a6c25a7f4d83a8e918fb0d2 |
|
MD5 | f6bc9f1b3ad56c4b56eaac4181c10316 |
|
BLAKE2b-256 | dd792e770e2e78d8e94cf6cb07136f2ad0ca1c04ea09f043402bd710b38f9060 |