Skip to content
Evan Zelkowitz edited this page Jan 7, 2018 · 7 revisions

Welcome to the discord-key-bot wiki!

Initial Setup

To build you will need the discordgo package and a working go environment

go get github.com/bwmarrin/discordgo

You can then do a go build in the repo

You will have to edit the provided conf.json with your own information. You will need a discord app and corresponding bot which you can generate here. Once you have a bot allocated to your application you can find the token under the bot's username

https://discordapp.com/developers/applications/me

The broadcast channel needs to be the actual discord ID of the channel you want to use. You can find this by enabling the developer options in discord under your user settings-Appearance. Then you can right click on your channel name and copy its ID value

Finally the path to the keys file needs to be an absolute path to where you wish to store the keys database

All of these settings need to be contained with quotes

Running

Now that you have it built and setup you will need to invite the bot in to your server on which you have manage server permissions. You can do this through this url

https://discordapp.com/oauth2/authorize?&client_id=BOT_CLIENT_ID_VALUE&scope=bot&permissions=0

You will need your bot client ID which is available on your discord application page at the top

Once you have your built bot and conf.json file you can run the bot with ./discord-key-bot -c conf.json. If everything was done correctly your bot should join your server and announce itself on your broadcast channel.

The bot will need permissions in that channel to manage messages which can be set through a role for the bot. This is necessary so it can remove any !add commands done by mistake in the channel so as not to publicly expose keys

Usage

Available Commands

!add game name key - this will add a new key to the database. This should be done in a DM with the bot

!listkeys - Lists current games and the number of available keys

!take game name - Will give you one of the keys for the game in a DM

!search search-string - Will search the database for matching games

The bot will also respond to !help to display this list

Clone this wiki locally