Managing Variables

This page will show you how to manage variables using the dashboard (If you prefer to use the endpoint, it'll be at the bottom of the page)

Using the CharmCord variable can seem daunting at first but this guide will attempt at explaining it in a simpler way for your understanding!

The page below is: https://dashboard.charm-cord.com/edit/variables

What if I don't see those boxes?

If you don't see the boxes in the image above after going to the link, it could possibly mean that you hadn't logged in! We use Discord's oauth login to keep everyone's data private and safe from one another.

You can log in by clicking the discord logo at the top right of the screen:

Once you log in, you should see the discord logo change to your profile picture along with it loading you back at the main page. To get back to the previous page just click "Edit Variables"


What are these parameters?

When creating a variable, the parameter you fill in can be a little confusing so you can refer to the chart below to help explain.

To start you have to understand what an "Action" is. It's exactly what it sounds like, the action you're taking. The action always determines which of the other selections are required

Your discord bot token is needed for authorization as to verify that you own the bot that you're trying to add a variable. As well as letting only YOU edit and delete your own variables

NameDescriptionExpected ValueExampleRequired

Action

The action you want to take with the given variable.

1 of the following:

Create | Delete | Edit

Delete

True

Bot Token

Your Bot's Token to verify that it's only the bot owner editing the variables

Discord bot token

N/A

True

Variable Name

The name you want to give to the variable

A name without and spaces, symbols, or numbers

Random

True

Variable Type

The type of variable you are creating

1 of the following:

Var | Servervar | Uservar

Var

True

Variable Value

The vaue of the variable

Any

123abc

True only when action is Create or Edit

Value Type

The type of the value you are using

1 of the following:

String | Integer | List

String

True only when action is Create or Edit


Simple Example

Your Key

When you successfully fill in all the boxes and press the button, if you don't recieve any error you should get a message saying that it was successful and recieve a key alone with it like below. This key is used in the other endpoints to access the variables to set them for specific users, servers, etc.. You should copy it and keep it somewhere safe, as it will not be shown again

Final Product


For anyone who wants to program it themselves or is feeling bold enough to use the api endpoint instead, the method is below for use!

POST https://www.charm-cord.com/database/<action>/<vartype>

Path Parameters

NameTypeDescription

action*

String

1 of the following:

Create | Delete | Edit

vartype*

string

1 of the following:

Var | Servervar | Uservar

Query Parameters

NameTypeDescription

token*

string

Your discord bot token

variable*

string

The name of your variable

id*

Int

Your discord ID

value

Any

The value of the variable

type

String

1 of the following:

String | Integer | List

{
    "Status": "Successful! Don't forget to grab your key: [KEY]"}
}

Last updated