View Source Getting Started
This guide is an introduction to DiscoLog. It will guide you through the setup of DiscoLog and how to use it.
Install DiscoLog
The first step is to add DiscoLog to your applicaiton is to declare the package as a dependency in your mix.exs
file.
defp deps do
[
{:disco_log, "~> 0.7.0"}
]
end
Then run the following command to fetch the dependencies.
mix deps.get
Setup the Discord Server
You need to register a Discord Account
Create a community Discord Server
A Discord community server needs to have a forum-type channel, which we use for error tracking.
![Create Server step 1](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/1-create-server.png)
![Create Server step 2](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/2-create-server.png)
![Create Server step 3](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/3-create-server.png)
Edit the Discord Server settings
Right-click on the server and select Server Settings
> Community Settings
![Edit Server step 4](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/4-edit-server.png)
![Edit Server step 5](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/5-edit-server.png)
![Edit Server step 6](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/6-edit-server.png)
![Edit Server step 7](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/7-edit-server.png)
![Edit Server step 8](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/8-edit-server.png)
Copy the server ID, it will be needed later
+If you don't see Copy Server ID
in the UI, enable developer mode in Settings -> Advanced -> Developer Mode.
![Edit Server step 9](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/9-copy-server-id.png)
Create a Discord Bot
Go to the developers portal
![Create bot 1](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/10-create-bot.png)
![Create bot 2](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/11-create-bot.png)
Disable User Install and add the scope bot
and the permissions Attach Files
, Manage Channels
, Manage Threads
, Send Messages
, Send Messages in Threads
![Bot settings](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/12-bot-settings.png)
Generate and copy the bot token, it will be needed later
![Bot token](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/13-bot-token.png)
Add Bot to your Server
Go to the installation menu and open the installation link
![Instal Bot on your server step 1](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/14-install-bot.png)
Follow the steps
![Instal Bot on your server step 2](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/15-install-bot.png)
![Instal Bot on your server step 3](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/16-install-bot.png)
![Instal Bot on your server step 4](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/17-install-bot.png)
Create DiscoLog channels
Edit your config/dev.exs
and add the following configuration with the bot token and the server ID you copied earlier.
config :disco_log,
otp_app: :app_name,
token: "YOUR_BOT.TOKEN",
guild_id: "YOUR_SERVER_ID"
Run the mix task
mix disco_log.create
It will create and output the rest of the necessary configuration for you. Use this configuration for your production environment or add it to your dev config if you want to test.
Confirm that everything is working smoothly by running the following mix command it will put a log in each channels.
mix disco_log.sample
How it should look like
![Sample log 1](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/18-sample-log.png)
![Sample log 2](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/19-sample-log.png)
![Sample log 3](https://raw.githubusercontent.com/mrdotb/i/master/disco-log/20-sample-log.png)
After setup
When you confirmed that the setup is working you should put this config to disable DiscoLog in dev.exs
and test.exs
env.
config :disco_log,
enable: false
Enjoy using DiscoLog!