📔
Spigot Plugins
  • Overview
  • Map-Ads
    • Map-Ads Overview
    • Installation and configuration
      • Help book configuration
      • Language file
      • Discord integration
      • Economy plugins
    • Setup
    • Developer API
      • Transition recording format
    • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. Map-Ads
  2. Installation and configuration

Discord integration

PreviousLanguage fileNextEconomy plugins

Last updated 2 years ago

Was this helpful?

If you want to use the Map-Ads Discord integration you need to download the extension and drop the file into your plugins folder.

Staff members need the 'Manage messages' permission to accept/deny ads using the buttons.

How the default settings look like

Configuration

Default config (discord.yml):

enable: false
token: "?"

storage:
  sqlite:
    path: "discord.db"

activity:
  online-status: "ONLINE" # ONLINE, IDLE, DO_NOT_DISTURB, INVISIBLE
  type: "WATCHING" # LISTENING, WATCHING, COMPETING
  text: "the server" # type + text = "watching the server"

time-format: "dd.MM.yyyy HH:mm:ss"
message:
  title: "Advertisement by {{PLAYER_NAME}}"
  description: |-
    Player {{PLAYER_NAME}} (`{{PLAYER_ID}}`) submitted a new advertisement
    ID: {{ADVERT_ID}}
    Date: {{TIME}} (<t:{{TIME_RAW}}:f>, <t:{{TIME_RAW}}:R>)
    Screen: {{SCREEN}}
    Purchased minutes: {{MINUTES}} for ${{PRICE}}
  color: "#00AFFE"
  image: "{{IMAGE_URL}}"
  #thumbnail: "{{IMAGE_URL}}"
  button:
    accept: "Accept ad"
    deny: "Deny ad"

channel-ids: [ ]

enable & token

enable is a simple toggle for enabling or disabling the extension. The token field holds your Discord bot token.

Creating a Discord bot token

  1. Click 'new application'

  2. Enter a name of your choice and click 'create'

  3. On the left sidebar click 'Bot'

  4. Click 'add bot' and confirm

  5. (Optional) Change the picture and username

  6. (Optional) Disable 'public bot'

  7. Click 'reveal token', copy the token and paste it into the 'token' field in the discord.yml file

  8. On the left sidebar click 'OAuth2'

  9. Scroll down and select the 'bot' scope

  10. Scroll down even further and select the permissions (At least 'View channels', 'Send messages', 'Manage messages', 'Read message history')

  11. Copy the link above the permissions selector and enter it into your browser

  12. Select the server and invite the bot

activity

This controls the bot appearance.

online-status: Either ONLINE, IDLE, DO_NOT_DISTURB or INVISIBLE

type: Either WATCHING, LISTENING or COMPETING

text: Text of your choice, will be displayed next to the type ("Watching the server")

time-format

Format for dates and time (used for the {{TIME}} placeholder)

message

Controls the appearance of the message. The image and thumbnail fields are optional and can be removed. color has to be specified using hex.

Placeholders:

{{PLAYER_NAME}} - Player name

{{PLAYER_ID}} - Player uuid

{{ADVERT_ID}} - Advertisement ID

{{TIME}} - Formatted ad creation according to the specified format

{{SCREEN}} - Name of the ad screen

{{MINUTES}} - Purchased minutes

{{PRICE}} - Price paid

{{IMAGE_URL}} - Url of the submitted image

channel-ids

Enter the ID of every channel that should receive a message here. Example: channel-ids: [ "123456789", "123567864" ]

Visit and log in with your Discord account

See for an explanation on how the format works

{{TIME_RAW}} - Ad creation time in seconds (can be used for )

Check out if you don't know how to get your channel ids

https://discord.com/developers/applications
this page
Discord's time formatter
this article
Download extension here