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
# Latest Release
python -m pip install spectrum.py
# Latest in Github
python -m pip install git+https://github.com/henry232323/spectrum.py
Examples
With Gateway
import asyncio
from spectrum import Client, Message
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(
rsi_token=...,
device_id=...,
)
asyncio.create_task(myclient.run())
await asyncio.Event().wait()
asyncio.run(run())
HTTP Only
import asyncio
from spectrum import HTTPClient
async def run():
client = HTTPClient(
rsi_token=...,
device_id=...,
)
await client.identify()
member = await client.fetch_member_by_handle("Khuzdul")
print(member)
await client.close()
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.
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
File details
Details for the file spectrum.py-0.0.3.tar.gz
.
File metadata
- Download URL: spectrum.py-0.0.3.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26df38ecfd76481551c41fb7a822ec1cbd56c0edcf422edfd6c2680ad14c4254 |
|
MD5 | 6b77b2d1374e958fea9867106f7b21f6 |
|
BLAKE2b-256 | bffa02a394a158f7b116081936a5bb9e2e3eed030cc29fb6888f254d8963c4fa |
File details
Details for the file spectrum.py-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: spectrum.py-0.0.3-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e37dc830cc227f82cc76e853f98116d2d2520b39daace8a5e0b80cc0935cb8f |
|
MD5 | 4ef0e23631d2274114c2e4c6de6dd168 |
|
BLAKE2b-256 | d87e80c208f6a9ca9094e12de5e37e63410afac4c7acda0e3203352445b4cf91 |