Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

guilds package

Overview

Package guilds records which Discord server a court's moderators chose.

WHY A SEPARATE REALM. kourtv2 is deployed and knows nothing about Discord, and a realm on chain is not edited — adding a field there means a new realm and a migration for every court that exists. This holds one string per court and asks kourtv2 who may set it, so the court's own moderator list stays the only authority and this file never has one of its own.

WHY IT EXISTS AT ALL, when the service could verify a signed message and did. It could, and the signature had to be made at a terminal, because a wallet signs TRANSACTIONS and not arbitrary strings. So the last step of standing up a court's Discord server was a command nobody would ever discover, and the court page said so and stopped. A realm call IS a transaction, which is exactly what a wallet already does — the same button every other action on the page uses.

WHAT IT DOES NOT DO. It does not check that the guild exists, that the bot is in it, or that anybody can join it. Those are the service's to know and it already does; this records a CHOICE, made by an address the court recognises, at a height anybody can read back. A guild id here with no bot behind it is a court pointing at nothing, which is visible rather than dangerous.

Function

Chosen

func Chosen(courtSlug string) (guildID, by string)

Chosen is the whole record: the server, and the address that chose it.

ONE READ AND NOT TWO, and this exists for that reason alone. kourt.xyz asks both questions together and acts on the pair — it publishes the guild AND records the setter as who signed for it — and two qeval calls can straddle a change. A moderator re-aiming the binding between them hands one decision's guild to another decision's signer, which is then written into the site's database as fact. A pair that cannot be read atomically should not be read as a pair.

BOTH EMPTY OR NEITHER. A court that never chose answers ("", ""), which is the commonest answer and is not an error.

THE SETTER IS WHO ASKED, NOT WHO MODERATES NOW. A court that replaces its moderators does not change this — the choice was made by whoever made it, and rewriting that would destroy the only record of who did. Whether they STILL moderate is a separate question, and kourtv2 is the one to ask it.

STRINGS AND NOT AN address, because the caller is a machine reading qeval's printed output: an address prints as `("g1…" .uverse.address)` and a string as `("g1…" string)`, and the second is the one a parser can hold to.

Param

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/guilds.Chosen()"

Result