easy-api.ts
Version:
A powerful library to create your own API with ease.
1 lines • 914 B
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0});let APIFunction_1=require("../../classes/structures/APIFunction"),Error_1=require("../../classes/structures/Error"),Util_1=require("../../classes/internal/Util");class StringRepeat extends APIFunction_1.APIFunction{name="$stringRepeat";description="Repeat the given text certain amount of times.";parameters=[{name:"Text",description:"The text to work with.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null},{name:"Times",description:"How many times to repeat the word.",type:APIFunction_1.ParamType.Number,required:!0,rest:!1,defaultValue:null}];usage="$stringRepeat[text;times]";returns=APIFunction_1.ParamType.String;aliases=["$repeatText","$repeat"];compile=!0;async run(e,[t,r]){if(Util_1.Util.isNumber(r))return t.repeat(Number(r));throw new Error_1.InvalidFieldIndex(r,e.function,"Repeat Times")}}exports.default=StringRepeat;