spectrum.py is a [discord.py](https://github.com/Rapptz/discord.py) style proof-of-concept library for making chatbots for Star Citizen's [Spectrum](https://robertsspaceindustries.com/spectrum/community/SC) chat client.
Project description
spectrum.py
spectrum.py is a discord.py style proof-of-concept library for making chatbots for Star Citizen's Spectrum chat client.
Installation
python -m pip install git+https://github.com/henry232323/spectrum.py
Example
This example requires python-dotenv
.
import asyncio
import os
from dotenv import load_dotenv
from spectrum import Client, Message
load_dotenv()
class MyClient(Client):
async def on_message(self, message: Message):
print(message)
async def on_ready(self):
print("We're ready!")
async def run():
myclient = MyClient(
token=os.environ.get("RSI_TOKEN"),
device_id=os.environ.get("DEVICE_ID")
)
asyncio.create_task(myclient.run())
await asyncio.Event().wait()
asyncio.run(run())
Authentication
The bot can be run in a read only state without any authentication. If you want to be able to send messages or read private messages (and eventually do other things), you'll need to provide credentials for an RSI account. These can be found in the cookies sent with any request to RSI when logged in.
Todo
- Fetch MOTD
- Fetch emojis
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
Built Distribution
Hashes for spectrum.py-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd541c915e2ac73837b6da4514d6c84c7c713bf3666fc9da5921e2fb7412d516 |
|
MD5 | 2918ab93ff69a3c3c67e8c3206a062ab |
|
BLAKE2b-256 | 85d1fd57ca38497b943f6602a87784453f689d45e2de43a6103a191ba2b4fc84 |