Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Setting up a Discord webhook

pekempy edited this page Jul 11, 2023 · 7 revisions

Editor's note: this is still a very rough draft, but it should be usable

This page goes over the optional integration with Discord, which sends notifications of Shiny Pokémon to a Discord channel via a webhook. If you want to use this, make sure you have a Discord account and a server you own, this page assumes you've already got a Discord server ready to go.

Generate Webhook URL

First of all, you need to create a webhook from within your Server's Settings: obraz

Now, you can customize your webhook - where it'll post its messages, and its name or profile picture: obraz

These can be changed at any time, so you don't have to set them now. What you need is to click the Copy Webhook URL button.

Now, open config.yaml from the bot's directory in a text editor of choice and paste what you've copied into the discord_webhook_url field.

Note: the subdomain (between https:// and discord.com) may be different or absent entirely, depending on which "edition" of Discord you're using, don't worry about it.

obraz

Find your User / Role ID

If you want to be mentioned for the alerts, you need to enable Developer Mode within Discord.

obraz

With this option enabled, if you right click on a user or role, you'll see a new option titled Copy User ID or Copy Role ID respectively.

obraz

Webhook Configuration in config.yml

Once you have the IDs, it's time to configure the bot to use them.
An example configuration is below
image

In the config, find the section headed # Discord Webhook settings
The first setting is rich_presence: - this will show a section on your profile with your current encounter information, and how long the bot has been running.
image

To receive any webhook messages, messages: needs to be set to true
Your main webhook URL goes below this.
iv_format has two options, basic, and formatted - both of these are shown below.
On the left, you see basic, and on the right formatted
IVs

The next section of the config has various settings for which notifications you want to receive.

  • shiny_pokemon_encounter: will trigger each time you encounter a shiny Pokémon.
  • pokemon_encounter_milestones: will trigger at regular intervals (e.g. "Achieved 10,000 total Seedot encounters!")
  • shiny_pokemon_encounter_milestones: will trigger at regular intervals for how many of each species you have shiny (e.g. "Achieved 5 total shiny Seedot encounters")
  • total_encounter_milestones: will trigger to notify you of total encounter milestones (surprisingly!) (e.g. Achieved 150,000 total encounters!")
  • phase_summary: triggers at regular intervals, by default it will first trigger when you're 8,192 encounters in (the shiny rate), and after that every 5,000 encounters. This gives a summary of IV sum records, SV records, Pokémon streaks and more.

All of the above settings for webhooks have the same configuration:

  • enable: either true or false - If it's set to false, you won't receive these messages
  • interval: A number for how often to send regular encounter milestones
  • ping_mode: either user or role - depending on which ID you provide, this will create a pinging notification in Discord to alert you of the webhook message.
  • ping_id: The ID you found in the section above that will be pinged
  • #webhook_url: If you want shinies and encounter milestones to go to different discord channels, or even different servers, you can specify the webhook URL for each notification type.
    Note: By default, this is disabled by the #. If you're configuring multiple channels, change this to webhook_url: instead of #webhook_url:

If you want to test your webhook URL, you can use a website such as this to force a message to the server.

VERY IMPORTANT NOTE
Never share your Webhook URL in any screenshots, or a pasted message in the Bot Plays Pokémon Discord server.
This is sensitive information and would allow other users to message your server without being there!

Clone this wiki locally