Skip to main content

The hrbot is a wrapper on top of the HighRise Python Bot SDK that makes it easy to create bots in HighRise.

Project description

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()  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hrbot-0.1.4.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hrbot-0.1.4-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file hrbot-0.1.4.tar.gz.

File metadata

  • Download URL: hrbot-0.1.4.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.2 Windows/10

File hashes

Hashes for hrbot-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e7b4e7d641f0c9d769f4b28bc4a5bafa716d19f614584f0df3cd51676d807755
MD5 cc9e30c5e82e387494589d57f0731e42
BLAKE2b-256 64a9752d1e911faa6526f5b0d66a0920c4e6e7e147620ad17cb89dc9c8412a03

See more details on using hashes here.

File details

Details for the file hrbot-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: hrbot-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.2 Windows/10

File hashes

Hashes for hrbot-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 393704c520bfdedc4ec1186ace72c80416720bb34048f1063a4b8526f1c5d952
MD5 f4727ea2433aadcfbfe52e513422ad37
BLAKE2b-256 4b6abf3be51e7a6e9ce93f9d32460d2d9d37020273cec00d66de9aa623b3bd3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page