Discord Chatbox | XenForo Italia | Your guide to the xenForo world
Discord Chatbox

Discord Chatbox

wizardVerified member

Administrator

Staff member
Vip Member
Reputation: 61%

This is a free addon provided by Widget Bot which provides a free widget solution


Compatibility with XenForo: 2.2, 2.3

1.webp


Disclaimer: This is a free addon provided by Widget Bot which provides a free widget solution with the option to upgrade to different plans for more premium offers. Please check widgetbot.io for more details. I am in no way affiliated with Widget Bot and am simply putting together code for the end user to easily implement into their forum.

Hello everyone!

The way of the chat box is in some ways old school with competing solutions growing and becoming more popular. One such instance of a chat service is Discord which provides a free tool to communities to organize and communicate through chat rooms and voice chat. This code allows implementation of Discord's features into Xenforo using Widget Bot.

In this guide we will be adding a custom template, adding some extra css to the site, and adding an insertable tag onto the page we want to display the html box on.

Discord Setup:

  1. Read the install guide located here Tutorial | WidgetBot
  2. Follow the link in the tutorial to invite the bot to your server.
  3. Give the bot all of the permissions required to function.
  4. In a text channel on your discord server type "/setup"
  5. Hit get started
  6. Tag the channel you would like to use to ensure proper permissions for the bot. Example could be "#general"
  7. Select continue
  8. Tag the channel for error logging. Example could be "#bot-commands"
  9. Choose to enable guests or continue without guests (recommended)
  10. In the text channel type "/html-embed" to get the HTML code we will use later. It should look like this
Code:
You must log in to view
(6 lines)

NOTE: You may need to edit the channel id to the channel you would like to default to. To do this right click the channel you want and select "copy link" and extract the channel id from the last set of numbers

Code:
You must log in to view
(1 lines)

  1. make sure this in not a private channel or else nobody will be able to see it.
Xenforo Template setup:

  1. Go to the template editor under Admin >> Appearance >> Templates >> Select your default template
  2. Select add template
  3. Name the template "discord.chatbox"
  4. Paste the following code into the template box
Code:
You must log in to view
(11 lines)

  1. Edit the code with your server ID and channel ID as we generated in the discord steps above
  2. Edit the width and height to match your desired preferences
  3. Save the template

  4. Go back to the template list in step 1 but this time scroll down until you locate "extra.less" and click on it.
  5. Paste the following CSS code into extra.less
CSS:
You must log in to view
(9 lines)

  1. Save the template

  2. Go back to the template list in step 1 but this time locate "forum_list" and paste this code at the top
Code:
You must log in to view
(1 lines)

  1. Save the template
Load your forum list and you should see the new chatbox!

If you get permission errors double check the discord bot is in your server, that you have the correct server and channel ids in the main html code, and that the correct permissions are set up to allow regular discord users to see the chat.

2.webp
3.webp
 
Back
Top