Skip to main content

A simple bot framework for Hack.chat.

Project description

Hiyobot

A simple bot framework for Hack.chat.

How to use

Execute pip3 install hiyobot on your console. in some case, it will be pip.The output should looks like:

Collecting hiyobot
  Downloading hiyobot-<version>-py3-none-any.whl (8.3 kB)
Requirement already satisfied: websocket-client in c:\users\administrator\appdata\local\programs\python\python310\lib\site-packages (from hiyobot) (1.3.2)
Installing collected packages: hiyobot
Successfully installed hiyobot-<version>

Example Bot

from time import sleep
from hiyobot import Bot,Matchers,Matcher,Utils,HIYOBOT_VERSION
bot=Bot("your-channel","TestBot","12345") #Channel,Bot-nick,Password(optional)
@bot.on(Matcher(Matchers.startswith("./ping"))) #Run when recived message that startswith "./ping"
def on_message(data):
    bot.send("Pong!") # Pong!
    @Utils.run_in_new_thread #Run following function in a new thread
    def _():
        sleep(5)
        bot.send(f"Pong! this message is sent by a new thread. also, with POWERFUL [HiyoBot](https://github.com/MaggieLOL/hiyobot) HCBot Framework Version {HIYOBOT_VERSION}!") # Pong#2
bot.run() #Enter the Bot mainloop

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

hiyobot-0.0.8.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

hiyobot-0.0.8-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

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