🎫Ticket System

In-game support tickets with Discord integration

Let players open support tickets from in-game that create private Discord channels for your staff to respond.


How It Works

Player opens ticket β†’ Private Discord channel created β†’ Staff replies β†’ Player receives whisper
  1. Player sends a ticket message using the ticket action

  2. RagnaSync creates a private channel named ticket-{playername} in your Discord

  3. Staff type in the channel and their messages whisper directly to the player

  4. Ticket closes when the player logs out or staff uses /close_ticket


Setting Up Ticket Support

Create the Support NPC

Place this NPC where players can easily find it:

prontera,156,180,4	script	Support	100,{
    mes "[Support]";
    mes "Need help? Open a ticket and staff will respond.";
    mes " ";
    mes "Your messages go directly to our Discord support team.";
    next;

    if (select("Open/Send Ticket:Cancel") == 2) close;

    mes "[Support]";
    mes "Type your message:";
    next;

    input .@message$;

    if (.@message$ == "") {
        mes "[Support]";
        mes "You didn't enter a message.";
        close;
    }

    // Send ticket message
    ragnascript("[action: ticket][account_id: " + getcharid(3) + "][char_id: " + getcharid(0) + "][name: " + strcharinfo(0) + "][message: " + .@message$ + "]");

    mes "[Support]";
    mes "Your message has been sent!";
    mes " ";
    mes "Staff will reply via whisper. Keep an eye on your chat.";
    close;
}

What Happens in Discord

When a player sends their first ticket message:

  1. A new channel #ticket-playername appears in your Discord server

  2. The channel is private (only visible to staff with the right permissions)

  3. Staff see a welcome message with the player's name

  4. The player's message appears in the channel

Example:


Replying to Players

Simply type in the ticket channel. Your message will be whispered to the player in-game:

Discord
In-Game

Have you checked your storage?

Player sees: @StaffName: Have you checked your storage?

The player can reply by talking to the Support NPC again - their messages appear in the same Discord channel.


Closing Tickets

Tickets close automatically when:

  • Player logs out - Channel is deleted after a brief moment

  • Staff uses /close_ticket - Type this command in the ticket channel

When a ticket closes:

  1. A "Ticket Closed" message appears in the channel

  2. The Discord channel is deleted after 2 seconds

  3. Database records are cleaned up


Multiple Messages

Players can send multiple messages to the same ticket. Each message from the NPC goes to the existing ticket channel:


RagnaScript Format

Field
Required
Description

action

Yes

Must be ticket

account_id

Yes

Player's account ID

char_id

Yes

Player's character ID

name

Yes

Character name (used for channel naming)

message

Yes

The support message (max 500 characters)


Channel Topic Format

When a ticket channel is created, the topic contains helpful information:

The bracketed data contains character information used for message routing:

Position
Field
Description

1st

account_id

Player's account ID

2nd

char_id

Character ID

3rd

char_name

Character name

This data is used internally by RagnaSync to route your replies to the correct player. You don't need to modify it - just type your message in the channel!


Tips

Channel naming - Ticket channels are named ticket-{name} in lowercase. Special characters in names are handled automatically.

Staff permissions - Make sure your support staff have permission to see the ticket channels in Discord.

Rate limiting - Consider adding a cooldown to prevent ticket spam:

Offline players - If a player logs out and staff replies, the message won't be delivered. The ticket channel will already be closed by then.


Quick Reference

Action
What Happens

Player sends first ticket

New #ticket-name channel created

Player sends more messages

Messages appear in existing channel

Staff types in channel

Player receives whisper in-game

Player logs out

Ticket channel deleted

Staff uses /close_ticket

Ticket channel deleted


Need help with other features? Check out RagnaScript Overview.

Last updated