Community
Defined in: zaun/js/index.d.ts:81
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Community():
Community
Returns
Section titled “Returns”Community
Properties
Section titled “Properties”
readonlybots:Collection<string,BotCard>
Defined in: zaun/js/index.d.ts:108
Installed bots’ public cards, as last heard.
channels
Section titled “channels”
readonlychannels:Collection<string,Channel> &object
Defined in: zaun/js/index.d.ts:88
Type Declaration
Section titled “Type Declaration”create()
Section titled “create()”create(
name,options?):Promise<Channel>
Parameters
Section titled “Parameters”string
options?
Section titled “options?”parent?
Section titled “parent?”string | Channel
"text" | "announcement" | "voice" | "category"
Returns
Section titled “Returns”Promise<Channel>
client
Section titled “client”
readonlyclient:Client
Defined in: zaun/js/index.d.ts:82
commands
Section titled “commands”
readonlycommands:Collection<string,ApplicationCommandData>
Defined in: zaun/js/index.d.ts:106
Bot commands in this community, as last heard (each with its bot_id).
readonlydata:any
Defined in: zaun/js/index.d.ts:96
The cache as plain data.
description
Section titled “description”
readonlydescription:string
Defined in: zaun/js/index.d.ts:85
readonlydms:Channel[]
Defined in: zaun/js/index.d.ts:137
DM: this member’s open direct messages with bots, from the cache.
readonlyid:string
Defined in: zaun/js/index.d.ts:83
isOwner
Section titled “isOwner”
readonlyisOwner:boolean
Defined in: zaun/js/index.d.ts:86
readonlyme:Member
Defined in: zaun/js/index.d.ts:87
members
Section titled “members”
readonlymembers:Collection<string,Member> &object
Defined in: zaun/js/index.d.ts:94
Type Declaration
Section titled “Type Declaration”fetch()
Section titled “fetch()”fetch():
Promise<Collection<string,Member>>
Returns
Section titled “Returns”Promise<Collection<string, Member>>
readonlyname:string
Defined in: zaun/js/index.d.ts:84
presences
Section titled “presences”
readonlypresences: (Presence&object)[]
Defined in: zaun/js/index.d.ts:113
presence: every member not offline.
readonlyroles:Collection<string,Role> &object
Defined in: zaun/js/index.d.ts:91
Type Declaration
Section titled “Type Declaration”create()
Section titled “create()”create(
name,options?):Promise<Role>
Parameters
Section titled “Parameters”string
options?
Section titled “options?”permissions?
Section titled “permissions?”Returns
Section titled “Returns”Promise<Role>
Methods
Section titled “Methods”bot(
botId):Promise<BotCard>
Defined in: zaun/js/index.d.ts:110
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<BotCard>
botConfig()
Section titled “botConfig()”botConfig(
bot):Promise<Record<string,string>>
Defined in: zaun/js/index.d.ts:131
Owner only: the values set for a bot’s settings (secrets as "••••"); a key not
there uses its card’s default.
Parameters
Section titled “Parameters”string | BotCard
Returns
Section titled “Returns”Promise<Record<string, string>>
channel()
Section titled “channel()”channel(
id):Channel
Defined in: zaun/js/index.d.ts:97
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”configureBot()
Section titled “configureBot()”configureBot(
bot,values):Promise<Record<string,string>>
Defined in: zaun/js/index.d.ts:128
Owner only: sets or clears (null: back to the card’s default) the values of the
settings a bot declares (BotCard.config); resolves with every value the owner has set,
a secret one as "••••" (write-only). Rejects with FORBIDDEN (not the owner),
NOT_FOUND, or BAD_REQUEST for a key the bot does not declare. zaun-host 0.4.0.
Parameters
Section titled “Parameters”string | BotCard
values
Section titled “values”Record<string, string | null>
Returns
Section titled “Returns”Promise<Record<string, string>>
createInvite()
Section titled “createInvite()”createInvite(
options?):Promise<string>
Defined in: zaun/js/index.d.ts:100
Parameters
Section titled “Parameters”options?
Section titled “options?”expiresIn?
Section titled “expiresIn?”number
maxUses?
Section titled “maxUses?”number
Returns
Section titled “Returns”Promise<string>
disableBot()
Section titled “disableBot()”disableBot(
botId):Promise<BotCard>
Defined in: zaun/js/index.d.ts:122
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<BotCard>
dmSettings()
Section titled “dmSettings()”dmSettings():
Promise<DmSettings>
Defined in: zaun/js/index.d.ts:141
DM: whether bots may open DMs with this member.
Returns
Section titled “Returns”Promise<DmSettings>
enableBot()
Section titled “enableBot()”enableBot(
botId):Promise<BotCard>
Defined in: zaun/js/index.d.ts:121
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<BotCard>
fetchBots()
Section titled “fetchBots()”fetchBots():
Promise<BotCard[]>
Defined in: zaun/js/index.d.ts:109
Returns
Section titled “Returns”Promise<BotCard[]>
fetchDms()
Section titled “fetchDms()”fetchDms():
Promise<Channel[]>
Defined in: zaun/js/index.d.ts:139
DM: reloads the open DMs from the host.
Returns
Section titled “Returns”Promise<Channel[]>
grantBot()
Section titled “grantBot()”grantBot(
botId,grants):Promise<BotCard>
Defined in: zaun/js/index.d.ts:120
Parameters
Section titled “Parameters”string
grants
Section titled “grants”capabilities?
Section titled “capabilities?”permissions?
Section titled “permissions?”Returns
Section titled “Returns”Promise<BotCard>
installBot()
Section titled “installBot()”installBot(
pkg,options?):Promise<BotCard>
Defined in: zaun/js/index.d.ts:118
Owner only: installs the .zbot uploaded as attachment pkg, with the registry source
it was verified against, if any.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”grants?
Section titled “grants?”{ capabilities?: BotCapabilities; permissions?: string; }
grants.capabilities?
Section titled “grants.capabilities?”grants.permissions?
Section titled “grants.permissions?”string
rolePosition?
Section titled “rolePosition?”number
source?
Section titled “source?”Returns
Section titled “Returns”Promise<BotCard>
leave()
Section titled “leave()”leave():
Promise<void>
Defined in: zaun/js/index.d.ts:104
Leaves (the owner cannot). Once the host accepts, the community is forgotten here: its
state and member key leave the store, communityDelete follows with { t: "left" }, and
a later join of it from the same store starts afresh.
Returns
Section titled “Returns”Promise<void>
member()
Section titled “member()”member(
id):Member
Defined in: zaun/js/index.d.ts:98
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”registerBot()
Section titled “registerBot()”registerBot(
member,name?):Promise<BotCard>
Defined in: zaun/js/index.d.ts:133
Owner only: marks a member connected over SimpleX as an external bot.
Parameters
Section titled “Parameters”member
Section titled “member”string | Member
string
Returns
Section titled “Returns”Promise<BotCard>
removeBot()
Section titled “removeBot()”removeBot(
botId,options?):Promise<void>
Defined in: zaun/js/index.d.ts:123
Parameters
Section titled “Parameters”string
options?
Section titled “options?”keepData?
Section titled “keepData?”boolean
Returns
Section titled “Returns”Promise<void>
role()
Section titled “role()”role(
id):Role
Defined in: zaun/js/index.d.ts:99
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”setCommands()
Section titled “setCommands()”setCommands(
commands):Promise<ApplicationCommandData[]>
Defined in: zaun/js/index.d.ts:135
As a bot: replaces this bot’s commands.
Parameters
Section titled “Parameters”commands
Section titled “commands”(ApplicationCommandData | CommandBuilder)[]
Returns
Section titled “Returns”Promise<ApplicationCommandData[]>
setDmsFromBots()
Section titled “setDmsFromBots()”setDmsFromBots(
allow):Promise<DmSettings>
Defined in: zaun/js/index.d.ts:142
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<DmSettings>
setStatusText()
Section titled “setStatusText()”setStatusText(
text,options?):Promise<any>
Defined in: zaun/js/index.d.ts:115
Sets this member’s custom status here; no text and no emoji clears it.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”emoji?
Section titled “emoji?”string
expiresAt?
Section titled “expiresAt?”number | Date
Returns
Section titled “Returns”Promise<any>
updateBot()
Section titled “updateBot()”updateBot(
botId,pkg,options?):Promise<BotCard>
Defined in: zaun/js/index.d.ts:119
Parameters
Section titled “Parameters”string
string
options?
Section titled “options?”source?
Section titled “source?”Returns
Section titled “Returns”Promise<BotCard>