UNPKG

easy-api.ts

Version:

A powerful library to create your own API with ease.

1 lines 1 kB
Object.defineProperty(exports,"__esModule",{value:!0});let APIFunction_1=require("../../classes/structures/APIFunction");class SetVar extends APIFunction_1.APIFunction{name="$setVar";description=["Creates a variable in the database.","> Shown usage belongs to the default database.","> Usage can change if another databases are used."].join("\n");parameters=[{name:"Variable Name",description:"Variable name to be created in the database.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null},{name:"Variable Value",description:"The value for the variable.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null},{name:"Table",description:"Database table to save the variable into.",type:APIFunction_1.ParamType.String,required:!1,rest:!1,defaultValue:"main"}];usage="$setVar[varName;value;table?]";returns=APIFunction_1.ParamType.Unknown;aliases=[];compile=!0;async run(e,[a,t,r]){return e.server.db.setValue({key:a,value:t,table:r})}}exports.default=SetVar;