This is a Discord bot that will maintain a clean Looking For Group channel in your gaming Discord server. It was designed for the game Albion Online, but is suited for any multiplayer game.
The bot will listen a specific text channel, and accept commands in the form !lfg [group_type] [content_description]
.
- The
group_type
can be linked to a mentionable role on your server so that players can be pinged for content that they're interested in. - The
content_description
will be the headline of the embed. - The
!lfg
command will only be accepted if the host user is in a voice channel on the same server as the master channel. - Only one post is permitted per user, any posts made after the first will be ignored.
Any messages in the channel will be deleted, and those with a valid command are replaced with an embed containing all the information needed to join the group, and an invitation to the host's voice channel.
The bot by it's nature will filter out spam, and meaningless messages.
Additionally, when the host leaves their voice channel the post will be deleted if they do not return within 3 minutes. This ensures that all posts are current, giving your members a list of all the available content at a glance.
The bot can be configured to broadcast the embeds to channels on different servers, which can help improve the visibility of your posts.
The hard way!
- You need a server with Node.js installed
- Clone this repository into a folder somewhere on your server using the command
git clone https://github.com/qwalley/LFGBot.git
- Navigate to the LFGBot directory and install the bot's dependencies using the command
npm install
- Go to the Discord Developer Portal and log in using your usual discord account
- Select the
Applications
and click onNew Application
in the top right of the screen. - Enter the name of your new application and click
create
- Click on the
Bot
tab on the left-hand side, an then chooseAdd Bot
in the top right. - Click on the
OAuth2
tab on the left-hand side, and then choose thebot
option from the list of scopes. - Copy/paste the url into a broswer and replace the permission value with
76880
before hitting enter. The url should look like this:
https://discord.com/api/oauth2/authorize?client_id=your_client_id&permissions=76880&scope=bot
- If you are the owner of a Discord server you should be prompted to select which server you want to add the bot to.
- Click on the
Bot
tab on the left-hand side, then clickclick to reveal token
beside the bot's icon. Copy the token, and keep it private. - On you server, open
LFGBot/sample_config.json
in a text editor. paste your bot's token into the"token" = ""
field. - Rename
sample_config.json
toconfig.json
. Now in the command line typenode index.js
to start the bot. - Type
!guilds
and!roles
into a text channel in your discord to get the channel IDs and role IDs to fill in the other values ofconfig.json
. Once a ChannelID is assigned to themaster_channel
value, the bot will only accept commands in that specific channel. - The
!lfg
command will not work untilmaster_channel
andmaster_guild
are set.
Property | Required | Default | Description |
---|---|---|---|
name | no | "LFGBot" | doesn't actually do anything |
prefix | yes | "!" | Used to parse commands, characters like ! , $ , # are ideal |
leave_delay | yes | "180000" | Number of miliseconds that a host can their voice channel for before the bot deletes their post |
token | yes | none | Used by the bot to connect to your server |
broadcast_channels | no | none | An optional array of channelIDs to send copies of the LFG posts to |
master_channel | yes | none | The channelID of a text channel. This will be where commands are entered, and posts are made |
master_guild | yes | none | the guildID of a Discord server. The bot will use this to track voice activity, the master_channel should belong to the master_guild |
tag_roles | yes | A key:value pair. The key sets valid arguments for the !lfg command |
|
tag_roles[key][0] | no | The roleID of a mentionable role in master_guild , if set the bot will ping users who have this role when a post is made |
|
tag_roles[key][1] | no | A hex code for the colour assigned the embed for posts made with this role | |
tag_roles[key][2] | no | An emoji to help customize the posts |