embed-api
commands (client events) are used to control the state of the embed.
The navigate command changes the active channel of the embed.
::: tip Usage
embed.emit('navigate', {
guild: '299881420891881473',
channel: '368427726358446110'
})
:::
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.
::: tip Usage
embed.emit('login')
:::
The logout command logs the user out, if they are logged in.
::: tip Usage
embed.emit('logout')
:::
<iframe height="580" style="width: 100%;" scrolling="no" title="embed-api commands" src="https://codepen.io/advaith1/embed/NWexQLJ?default-tab=js%2Cresult&editable=true" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true"> See the Pen embed-api commands by Advaith (@advaith1) on CodePen. </iframe>