hiven.py
? Opensource Python wrapper for Hiven's REST and WebSocket API
Installation
pip install -U hiven.py
Usage
hiven.py is currently under development (that's going pretty fast), we have the basic receive + send message functionality for (jank) commands though!
Token
Hiven currently only supports selfbots so you'll need to get your Hiven token from the web application or the desktop client.
- Open the web app or desktop client
- Hit
Ctrl+Shift+I
to open Developer Tools - Navigate to the Console tab
- Type in
localStorage["hiven-auth"]
- Copy & paste the token in your code
Do not share this token with anybody
Quickstart
import hiven
from hiven import Client
bot = Client(bot=False) # set bot = True if you're controlling a bot account
@bot.event
async def on_ready():
"""Triggered when the bot is ready """
print("hello world!")
@bot.event
async def on_message(message: hiven.Message):
"""Triggered when a message (that the bot can see) is sent"""
if message.content.startswith("!hello"):
await message.room.send("hey there!") # respond to the message if it starts with !hello
bot.run(token="YOUR_TOKEN_HERE")