Skip to main content

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

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

spectrum.py-0.0.2.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

spectrum.py-0.0.2-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file spectrum.py-0.0.2.tar.gz.

File metadata

  • Download URL: spectrum.py-0.0.2.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

Hashes for spectrum.py-0.0.2.tar.gz
Algorithm Hash digest
SHA256 060439bb7a0f0769ad12215e43a263c168dc206fc888f443fff524f15dcf5a56
MD5 4d8f03b6d2437d2b66072751a8d71700
BLAKE2b-256 85282c67c18463714d3e1106c056ba475e6be42b4562c47bde6134095af40372

See more details on using hashes here.

File details

Details for the file spectrum.py-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: spectrum.py-0.0.2-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

Hashes for spectrum.py-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aa77bc46849cace47c6a05fde3e5c006f55ef694897db66239749b16af720ce6
MD5 e8bfc358637a04a1b4204fab7da1f6c3
BLAKE2b-256 86c872abf203886330859fa5f223f02652f46acc9e8947bda2e2abc4bfbadf18

See more details on using hashes here.

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