Skip to content

DiscordHook

David edited this page Oct 30, 2019 · 5 revisions

Author: Davnit / Pyro

Description: Sends chat events from Battle.net to a Discord webhook.

Commands: None

Settings: These go under [DiscordHook] in Scripts.ini

  • Hook: The full webhook URL to post events to.
  • ShowJoins: Set to "True" to send join/leave messages to the webhook. [Optional]
  • Channel: The name of the channel on Battle.net where messages should be sent FROM. [Optional]

Example:

[DiscordHook]
Hook=https://discordapp.com/api/webhooks/11111111/asdfghjsdklje_butalotlonger
ShowJoins=True
Channel=Op MyChannel

Setup Instructions

  • Download the script to your bot's scripts folder (Scripting menu -> Open Script Folder).
  • On Discord, edit the channel you want messages sent to, go to 'Webhooks' and then 'Create Webhook'. Give it a name and copy the webhook URL. You'll either need to have permissions on Discord to do this or get the URL from someone who does.
  • From the same script folder, open 'Scripts.ini' in a text editor, like Notepad.
    • If you don't see a line with [DiscordHook] then you'll need to add it at the bottom of your file.
    • Underneath [DiscordHook] add the line Hook=<your webhook URL> (replace <your webhook URL> with the URL you copied from Discord). It should look similar to the above example.
  • When you're done, save the file and reload your StealthBot scripts (Scripting menu -> Reload Scripts).
  • You might get a warning about incorrect line endings. You can ignore this as the bot will fix it automatically.
  • Messages should now be appearing in the channel where you setup the webhook.
You can’t perform that action at this time.