The hrbot
The hrbot is a wrapper on top of the HighRise Python Bot SDK that makes it easy to create bots in HighRise.
Install the library:
pip install hrbot
Features:
- Quick and easy creation of an unlimited number of handlers for any event
- FSM (finite state machine). Available storage in memory and Redis
- Large number of available conditions in handlers
- Web API support
Unreleased features:
- Spam blocking bypass. Allows you to send an unlimited number of identical messages
Example:
from hrbot import Bot, Dispatcher
from hrbot.types.hr import User
dp = Dispatcher()
bot = Bot(
api_key='',
room_id='',
dispatcher=dp
)
@dp.on_user_join()
async def user_join(user: User):
"""Triggers when a player joins a room"""
await bot.highrise.chat(f'Hi, {user.username}')
@dp.on_user_leave()
async def user_leave(user: User):
"""Triggers when a player leaves the room"""
await bot.highrise.chat(f'Goodbye, {user.username}')
@dp.on_chat(command='help', case_ignore=True, prefix='.!')
async def help_command(user: User, message: str):
"""Works for .help and !help messages. Not case-sensitive"""
await bot.highrise.chat("Some text for help command")
@dp.on_chat()
async def echo(user: User, message: str):
"""Works for all chat messages"""
await bot.highrise.chat(message)
if __name__ == '__main__':
bot.start()
Metadata
Release files for hrbot 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hrbot-0.1.4.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hrbot-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.2 kB
Release files / hrbot-0.1.4.tar.gz
| Download URL | hrbot-0.1.4.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7b4e7d641f0c9d769f4b28bc4a5bafa716d19f614584f0df3cd51676d807755
|
|
BLAKE2b-256 checksum How to use checksums |
64a9752d1e911faa6526f5b0d66a0920c4e6e7e147620ad17cb89dc9c8412a03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Windows/10
|
Release files / hrbot-0.1.4-py3-none-any.whl
| Download URL | hrbot-0.1.4-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
393704c520bfdedc4ec1186ace72c80416720bb34048f1063a4b8526f1c5d952
|
|
BLAKE2b-256 checksum How to use checksums |
4b6abf3be51e7a6e9ce93f9d32460d2d9d37020273cec00d66de9aa623b3bd3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Windows/10
|