Hello! This is an example / template bot using the halcyon matrix bot library. Feel free to ask questions in the matrix chat #halcyon:blackline.xyz
This bot will
- Sit in a room, and respond with the current price of a stock when some calls the ticker. For example "Hey guys, did you see that $UVKY just spiked?"
- Respond with the
- Stock name
- Current price
- Todays Percent change
- Join rooms via invite
- Set its status message
- A matrix account for the bot
- An free api key from IEX
- A place to run the bot
- Install Halcyon
python3 -m pip install halcyon
- Create a Halcyon token
python3 -m halcyon -s server.xyz -u @hstockbot:server.xyz -p "password"
- Save the above key, and along with your IEX key in a file called
creds.json
, formatted like below.
{
"halcyon":"eyJ0e==",
"iex": "pk_12"
}
- Run the bot
python3 bot.py
(orpython3 bot.py --debug
if you are restarting the bot often) - Invite the bot to an unencrypted room, and give it a test