Skip to main content

write bots for we.yarno — cards, inline forms, server-counted polls, live values, voice

Project description

yarno

write bots for we.yarno — the invite-only servers/channels/voice app.

pip install yarno

the shortest complete bot:

from yarno import Bot

bot = Bot()                    # reads $YARNO_TOKEN

@bot.command("hi", "says hi")
async def hi(ctx):
    return f"hi {ctx.username}"

bot.run()

no intents, no command tree, no sync() step, no 3-second deadline. your bot holds a live socket to the instance, so the decorator is the registration and a handler can take as long as it needs.

what you get

  • cards — compose rows, columns, progress bars, images, buttons instead of filling in an embed
  • inline formsui.input / ui.select / ui.toggle / ui.slider live in the card, in the channel; any click submits the whole form as ctx.values. no modals.
  • polls that outlive youui.button(collect="v:yes") is counted by the server, so votes land while your process is down; read them back with bot.tallies()
  • live valuesui.ticker / ui.bar(rate=...) / ui.slider(rate=...) advance on every viewer's screen; you push state changes, not frames. a seek bar that tracks the playhead is one component.
  • docked cards — pin one card above the channel's scroll (now playing, scoreboards, countdowns)
  • autocomplete — suggest argument values as someone types, over your already-open socket
  • dms, files, reactions, avatars, voice@bot.on_message, send(files=[...]), bot.react(), bot.set_avatar(), and bot.voice_join() with the yarno[voice] extra — music-grade stereo opus, and play() takes seek / ffmpeg filters / auth headers and reports the audio it actually delivered, so a real dj bot is yt-dlp + ffmpeg away
  • buttons that survive restarts — per-message state lives on the server and rides back with every click

privacy, stated up front

a bot sees nothing by default: commands aimed at it, clicks on its own cards, and dms it's part of. it does not receive channel messages, and there is no intent to flip on. the read apis hold the same line.

docs

examples live in examples/: pingpong.py is the core loop, lunchbot.py is forms + polls + autocomplete + a docked countdown.

tokens come from the dev console. we.yarno is invite-only; the sdk is public so bots can be written for it.

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

yarno-0.3.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yarno-0.3.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file yarno-0.3.0.tar.gz.

File metadata

  • Download URL: yarno-0.3.0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for yarno-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bb9ed480cec552424ae93dd46cc4f9126fbcc88ba0b5e82c92f13274e041849d
MD5 49469360bbd1d82d6a9be37af6e683c5
BLAKE2b-256 1cd011a15699d23622523a3853d9037690ed9d75e9d8781f7dd7d7406f1b1080

See more details on using hashes here.

Provenance

The following attestation bundles were made for yarno-0.3.0.tar.gz:

Publisher: publish.yml on alfaoz/yarno-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yarno-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: yarno-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for yarno-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b78f8bcf782b1e560b244fee58a03cef82f3ff3fbb8cc888e8546b5564392af9
MD5 c50868ecf63058f2c532bc4960743f82
BLAKE2b-256 0075f9b65ca7c6575db3112be4ab4795bd466c3cc6a602cf77cfdf6472082dd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for yarno-0.3.0-py3-none-any.whl:

Publisher: publish.yml on alfaoz/yarno-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page