Skip to content

Commands ​

embed-api commands (client events) are used to control the state of the embed.

The navigate command changes the active channel of the embed.

Usage

js
embed.emit('navigate', {
  guild: '299881420891881473',
  channel: '368427726358446110'
})

login ​

The login command requests the user to log in, if they aren't already logged in. It will show a guest login modal or a Discord login button, depending on whether the guild has guests enabled.

Usage

js
embed.emit('login')

logout ​

The logout command logs the user out, if they are logged in.

Usage

js
embed.emit('logout')

setChatVisible ​

On Discord v3, tell WidgetBot when your site shows or hides the chat. This lets the embed keep receiving DMs while hidden and acknowledge them when the user can see the open conversation. Pass true when visible and false when hidden. Unread DM badge example

Usage

js
embed.emit('setChatVisible', false)

Demo ​