The Unthread Discord Bot is a powerful tool designed to streamline support ticket creation and management within Discord servers. By using simple commands, users can easily create support tickets, which are then managed through the Unthread platform. This bot integrates seamlessly with Discord and Unthread, providing a smooth and efficient support experience for both users and administrators.
- Create support tickets using the
/support
command. - Automatically create support tickets from posts in specific forum channels.
- Easy setup and configuration through the Discord Developer Portal.
- Integration with Unthread for advanced ticket management.
- Customizable environment settings for personalized bot behavior.
Use /support
command to create a support ticket.
- Go to the Discord Developer Portal.
- Click on the "New Application" button.
- Give your application a name and click "Create".
- In your newly created application, navigate to the "Bot" tab.
- Click on the "Add Bot" button and confirm by clicking "Yes, do it!".
- Under the "TOKEN" section, click "Copy" to copy your bot token. You will need this later.
- Under "Privileged Gateway Intents", enable the "Message Content Intent".
- Navigate to the "OAuth2" tab and then to the "URL Generator" sub-tab.
- Under "SCOPES", select
bot
andapplications.commands
. - Under "BOT PERMISSIONS", select the necessary permissions for your bot.
- Use the following link to invite your bot to your server. Replace
YOUR_BOT_CLIENT_ID
with your actual bot client ID: https://discord.com/oauth2/authorize?client_id=YOUR_BOT_CLIENT_ID&permissions=1084479760448&integration_type=0&scope=bot+applications.commands
- Create a
.env
file in the root directory of your project. - Copy the contents of
.env.example
to.env
. - Fill in the required information:
DISCORD_BOT_TOKEN
: The token you copied from the "Bot" tab.CLIENT_ID
: Your application's client ID, found in the "General Information" tab.GUILD_ID
: The ID of the Discord server where you want to deploy the bot. How to Get Your Discord Server IDUNTHREAD_API_KEY
: Your Unthread API key.UNTHREAD_TRIAGE_CHANNEL_ID
: Your Unthread triage channel ID.UNTHREAD_EMAIL_INBOX_ID
: Your Unthread email inbox ID.UNTHREAD_WEBHOOK_SECRET
: Your Unthread webhook secret.
- Clone the repository and navigate to the project directory.
- Install the dependencies:
yarn install
- Start the bot:
yarn start
- The bot should now be running in your Discord server.
- Open your project in VS Code.
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).
- Type
Ports: Focus on Ports View
and select it. - In the Ports view, click on the
+
icon to add a new port. - Enter
3000
as the port number and press Enter. - Click on the globe icon next to the port to make it publicly accessible.
- Log in to your Unthread dashboard.
- Navigate to the "Settings" section.
- Under "Webhook Configuration", enter the following URL:
http://<YOUR_PUBLIC_URL>:3000/webhook/unthread
Replace `<YOUR_PUBLIC_URL>` with the public URL provided by VS Code.
- Save the settings.
Your bot should now be able to receive events from Unthread.
To enable automatic ticket creation from forum posts:
- Add forum channel IDs to your
.env
file:FORUM_CHANNEL_IDS=123456789012345678,234567890123456789
- Each comma-separated ID represents a forum channel that will be monitored.
- Any new forum posts in these channels will automatically create a corresponding ticket in Unthread.
- Replies in the forum post will be synchronized with the Unthread ticket.
- Open Discord and go to your server.
- Click on the server name at the top of the channel list to open the dropdown menu.
- Select "Server Settings".
- In the "Server Settings" menu, go to the "Widget" tab.
- Enable the "Server Widget" option if it is not already enabled.
- The "Server ID" will be displayed under the "Widget" settings.
Alternatively, you can enable Developer Mode to get the server ID:
- Go to your Discord user settings.
- Navigate to the "Advanced" tab under "App Settings".
- Enable "Developer Mode".
- Right-click on your server name in the server list.
- Select "Copy ID" to copy the server ID to your clipboard.
Contributions are welcome, create a pull request to this repo and I will review your code. Please consider to submit your pull request to the dev
branch. Thank you!
Read the project's contributing guide for more info.
Please report any issues and bugs by creating a new issue here, also make sure you're reporting an issue that doesn't exist. Any help to improve the project would be appreciated. Thanks! πβ¨
Like this project? Leave a star! βββββ
Want to support my work and get some perks? Become a sponsor! π
Or, you just love what I do? Buy me a coffee! β
Recognized my open-source contributions? Nominate me as GitHub Star! π«
Read the project's code of conduct.
This project is licensed under GNU General Public License v3.0.
This project is created by Waren Gonzaga under WG Technology Labs, with the help of awesome contributors.
π» with β€οΈ by Waren Gonzaga and Him π