Sign in to follow this  
Capi

[Discord Bot] WurmAVwebhook - Separate Village from Alliance Chat

Recommended Posts

Hello everyone,

 

I have made a simple code for separating the village and alliance chat. 

All you need is a webserver to host the bot, a bot user created at https://discord.com/developers/ and have the dev mode on Discord enabled.

It currently only allows one village input but I will allow separate channels per village in the future.

 

INSTALLATION:

  1. Create a new bot user at https://discord.com/developers/ . Name has to be the village name.
  2. Add it to your guild (discord server) with read/send message and read message history permissions)
  3. Insert your bot token in the .env file 
    BOT_TOKEN='YOUR TOKEN GOES HERE'
  4. Create an input channel and create a webhook to it. Oh and make sure to add and enable it ingame! 
  5. Create two output channels. Names are up to you. Copy the village and alliance channel IDs into the .env file
    OUTPUT_VILLAGE='VILLAGE CHANNEL ID'
    OUTPUT_ALLIANCE='ALLIANCE CHANNEL ID'
  6. Copy your Guild ID into the .env file.
    GUILD_ID='GUILD ID GOES HERE'
  7. Choose if you want to display the messages as embeds or plain messages
    USE_EMBEDS='true/false'

     

  8. Save everything and upload all files to a server.
  9. Run 'npm i' to install the bot
  10. Run the bot using something like the pm2 package (Make sure to run it from the base dir and not from /src. So it would look like this: 'pm2 ./src/index.js'
  11. Profit

 

To get the IDs just enable the dev mode (google it if you don't know how) and rightclick the channels and the guild name on the left navigation bar.

 

I hope this is all explained enough. If anything is unclear or you encounter a bug just post here or message me on the Wurm Online Discord Server which is usually quicker.

Feel free to use the source code to embed it to your bot or change it to your needs.

 

LINK:

https://github.com/CapiGe/WurmAVwebhook

 

 

If you need any help setting everything up drop me a Discord DM. 

 

Capi

Discord Administrator

  • Like 4

Share this post


Link to post
Share on other sites

Amazing work, very much appreciated. Will be testing it later today!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this