<script type="text/javascript" src="//cdn.jsdelivr.net/discord-widget/latest/discord-widget.min.js"></script>
<script type="text/javascript">
discordWidget.init({
serverId: '51143782082543616',
title: 'Discord Widget Title',
join: true,
joinText: 'Join Server',
alphabetical: false,
theme: 'light',
hideChannels: ['Channel Name 1', 'Channel Name 2'],
showAllUsers: true,
allUsersDefaultState: true,
showNick: false,
userName: '',
useCDN: true
});
discordWidget.render();
</script>
<div class="discord-widget"></div>
This is still being worked on. The only part not added yet is the Hide Channels option.
<iframe src="http://discordi.deliriousdrunkards.com/render?id=51143782082543616" width="300px" height="400px" frameborder="0"></iframe>
Parameter | Usage | Default |
---|---|---|
serverId [String] | Paste your Server ID from the Widget section of your Server Settings here. | false |
title [String] | A header will be added to the widget, containing the text supplied. | false |
join [Boolean] | Determines whether to show the Join Server button within the widget. | true |
joinText [String] | Sets the join button text. | 'Join Server' |
alphabetical [Boolean] | Determines whether the channel list will display in alphabetical order or not. | false |
theme [String ('light', 'dark', 'none')] | Pick your poison! 'none' removes all styling, including margins and padding around the widget. | light |
hideChannels [String Array] -or- [Boolean] | Hide channels. If the channel name contains the string provided, it will be hidden. If set to true, no channels will be displayed. | false |
showAllUsers [Boolean] | Show all online users, even if they are not in a voice channel. | false |
allUsersDefaultState [Boolean] | Sets whether the Online Users section is expanded or not by default. | true |
showNick [Boolean] | Sets whether the the users' server nick name shows or not. | false |
userName [String] | Sets the default username when joining the server (passes the `username` URL parameter). | '' |
useCDN [Boolean] | Sets whether or not to use the jsdelivr CDN. Set to false if using your own local css theme. | true |
If you run into trouble, let me know here.