Skip to content

Acting in a server

Beyond answering runs and presses, your wisp can act on its own:

var line = await wisp.SendAsync(channel, "The jackpot is open.", card);
await wisp.EditAsync(line, "The jackpot is closed."); // the card stays
await wisp.ReactAsync(line, ":fire:");
await wisp.DeleteAsync(line);
await wisp.SetRolesAsync(server, user, add: [vip]);
await wisp.KickAsync(server, user);
await wisp.BanAsync(server, user);
Call Does
SendAsync(channel, text, card?) posts a line; returns its id. replyTo: makes it a reply
EditAsync(line, ...) changes one of your wisp’s own lines. It changes only what it names: words alone keep the card
ShowAsync(line, card or patch) a live frame on your own line, kept nowhere (Cards)
ReactAsync(line, emoji, on?) adds a reaction, or takes it back with on: false
DeleteAsync(line) deletes your own line, or anyone’s with Manage messages
SetRolesAsync(server, user, add?, remove?) gives and takes roles, with Manage roles
KickAsync(server, user), BanAsync(server, user) with Kick members or Ban members
SetActivityAsync(words) your wisp’s own words, such as “Dealing blackjack”, shown under its name as a person’s status is

A card comes off a line only with the line: delete it.

What your wisp may do in a server is what its admin approved there: posting and reacting in the channels it works in, and managing roles, kicking and banning with the permissions it was given (How a server lets it in). Those permissions sit on a role made for your wisp, so it can only act on members and roles below that role, as any member can.

A call outside that throws with why it was refused, so branch on it:

try
{
await wisp.KickAsync(server, user);
}
catch (WispCallException e)
when (e.Why is Refusal.Permission or Refusal.NotGranted)
{
await run.AnswerPrivatelyAsync("I'm not allowed to kick here.");
}
C# e.Why TypeScript error.why Means
Refusal.NotGranted "not_granted" outside what the admin approved, such as a channel it does not work in
Refusal.Permission "permission" its roles, or the person’s, do not allow it
Refusal.NotFound "not_found" the line, member, channel or role is not there
Refusal.Invalid "invalid" the call breaks a rule; Woosh’s words say which

Woosh’s own words, such as “Missing permission: KickMembers.”, are there for your log (e.Words; in TypeScript, error.words). They may change, so write what people see from why.

A call that may or may not have gone through, because the connection dropped at that moment, is sent again by the library in a way that never posts twice. You never need to check whether a line landed before sending it again.


Writing your own library? The frames underneath are in Acting in a server, raw.

© 2026 Woosh AS. All rights reserved.