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=...) advance on every viewer's screen; you push state changes, not frames
  • 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
  • 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.2.0.tar.gz (16.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.2.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yarno-0.2.0.tar.gz
  • Upload date:
  • Size: 16.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.2.0.tar.gz
Algorithm Hash digest
SHA256 39e595c84cbd672bae59f9a1968c990ca5f743cd9c4731c018795366e7a604ca
MD5 10ec6a0c09905672cfcf2c3507e770c6
BLAKE2b-256 dddc9e4ae9b6387038ebaaf048a8c4ba8f46f863b67324a14855099da0b5f4b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for yarno-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: yarno-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 677e2698dc4ef77627e8214788c2163fc5c546eeb03f39b38b1c69d9fd3cca63
MD5 891649c673c2092d38bfe551b5db1154
BLAKE2b-256 72a36ae6f451a2a4c1786034d2fb51963f8c55c2b7256c92f2fa4768f035191a

See more details on using hashes here.

Provenance

The following attestation bundles were made for yarno-0.2.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