Skip to main content Link Search Menu Expand Document (external link)

Discord

The Discord plug-in gives Jancy the ability to “talk” to one or more Discord servers.

Quick Setup

You need from Discord:

  • a discord bot token
  • a client/application ID
  • a server ID

On the Jancy settings page you can choose Discord from the different sections and input these IDs and the token there.

Detailed Setup

Create an application and bot

New Application

First setup an application here Discord Application Page

Click the New Application button, fill out a name for the application, and accept the terms

image

image

Application ID

Get the Application ID (also called the Client ID in Discord and Jancy)

image

Next navigate to the Bot section on the left hand side menu. If you have never made a discord bot before you will see this page:

image

Click Add bot and follow the directions

Get Token

If you have made a bot you will see a page similar to this:

image

We need this token later. Copy it to a safe spot so you don’t have to reset it.

Configure the bot

Do the following:

  • Navigate to the “Installation” page, and set the install link to “None” if it isn’t already.

image

  • Make the bot private, if you want to be the only one allowed to connect them to a server
  • Turn on the Message Content Intent - this is so a bot can see message contents so it can respond accordingly if needed

image

Generate URL

Now we need to go to the OAuth2 menu on the left. To begin press “Add Redirect” button and then in the input box paste this: https://discord.com/api/oauth2/authorize. Then click away from the input and a notification pops up at the bottom of the page and asks to save changes, press “Save Changes”.

Next select permissions for the bot and it will generate a url at the bottom. This url will allow you to go through the next set of steps to connect to a server.

Please select the permissions as show in the image below.

image

Connect bot to your discord server

Use URL

Next we need to use the URL generated above

image

Set the server

Now we need to choose your server to add the bot to

image

Successfully connected

After passing a captcha, you will see this to know you have sucessfully added your bot to your server. You can also check your server user list to see the bot listed there.

image

Setup Discord Developer mode

Discord settings

Open the settings using the gear icon next to your name in discord.

image

Go to the Advanced Section You’ll have to scroll down a little ways to find it in the list

image

Make sure the Developer Mode is on or turn it on if it is not

image

Get Server ID

We need the server ID to connect Jancy and Discord properly. Please be sure to get the Server ID. The interface looks very similar to “Channel ID”, but on the “Server ID” is needed for this step.

image

Connect with Jancy

Go to the Discord section in Jancy settings image

Fill out the fields with the information we created above.

image

Press the play icon in the table to test the bot. You should get a message from your bot on your discord server in the #general channel. If you don’t have general channel the bot will attempt to use the default text channel for your server. Failing that, it will try any text channel. If there is a failure to post to the general channel there could be some access or permission issue. Check to see that the channel permissions will allow the bot to send messages to the channel.

image

Adding to channels

Public channels in a discord server add all the users by default and nothing needs to be done to add the bot to the channel.

Private channels need you to add the bot to it. The following images will help you to do that.

image

image

Using Discord

You can test with the play button. If you don’t have a #general channel you won’t see the test message.

You can also use it in our Purchase Coordination tool - Namath.

Custom Formats

You can now customize the default format on a provider to provider basis. When adding a new Discord provider for Namath you will be able to choose what fields to see.

Click the Edit button

image

A new window will appear:

image

Also, you can now create your own custom discord formatter by creating a JYL file. The format looks like:

<jyl>
  <namath-discord-format name="example2">
    console.log('hey example 2')
    const { Events, Client, GatewayIntentBits, ActionRowBuilder, 
    ButtonBuilder, ButtonStyle, EmbedBuilder, AttachmentBuilder } = require('discord.js')
    const em = new EmbedBuilder()
    let i = 0
    for (const field of cart) {
      const key = field.id
      em.addFields(field)
      i++
      if (i==4) {
        break
      }
    }
    return { content: `ex2`, components: [], embeds: [em] }
  </namath-discord-format>
</jyl>

It is provided the follow parameters:

  • cart is a cart an array of objects that will have the following fields:
    • uuid - the unique ID of the cart
    • tab - information about the tab the cart is from
    • row - the row
    • section - the section
    • seats - the seats in a string
    • event - the event name
    • venue - the venue name
    • quantity - the total number of tickets
    • currency - the format of the currency (USD)
    • total - the total cost of the cart
    • tax - the tax associated with the cart
    • costPerTicket - the cost of only the ticket (not including tax and fees)
    • dateTime - the date and time of the event as a formatted string
    • oddEven - if the seats are odd/even
    • deliveryMethod - the delivery method of the tickets
    • isInsured - boolean if insurance is selected
    • marketplace - the marketplace the ticket is coming from
    • feeAndCostPerTicket - the cost of each ticket including the tax and fees
    • ticketType - the type of the ticket
    • feesPerTicket - the amount of fees per tickets
    • seatMapURL - the url for the image of the seat map - sometimes this is corrupt and cannot be viewed
    • jancyUser - a string representing the user logged into jancy
    • jancyUsername - the name that you can set in the jancy settings to show instead of the jancy account email
    • quantity - the full amount of tickets in the cart
    • accountEmail - the email of the user logged into the marketplace
    • profileName - the name of the profile in use if any
    • groupName - the name of the profile group
  • cartObj - this is a simple version of the cart. It has no name or anything associated with it. It is just an object. e.g. cartObj.row will give you the row
  • jancy - (Jancy object)
  • require - the require library, it is needed to import discord.js

It must return a Javascript object with content, components, and embeds

  • content - is a string that will be in the message to Discord
  • components - is an array of component objects from Discord library like buttons
  • embeds - is an array of embed objects from Discord library embeds

You can choose it when you create a new provider:

image

FAQ

  • Can I use one token for many servers? Yes! Just add a new bot entry in Jancy with the same Client/Application ID and Token, but a new server ID