Comparing version 5.6.0-dev.1629062247.e02f3d8 to 5.6.0-dev.1629115384.3cd641c
@@ -38,3 +38,3 @@ import { ApplicationCommandPermissionData, Snowflake } from "discord.js"; | ||
static create(name: string, description?: string, argSplitter?: string | RegExp, directMessage?: boolean, defaultPermission?: boolean, guilds?: Snowflake[], botIds?: string[], aliases?: string[]): DSimpleCommand; | ||
parseParams(message: CommandMessage): (string | number | boolean | undefined)[]; | ||
parseParams(message: CommandMessage): (string | number | boolean | import("discord.js").GuildChannel | import("discord.js").GuildMember | import("discord.js").Role | import("discord.js").ThreadChannel | import("discord.js").User | null | undefined)[]; | ||
} |
@@ -93,7 +93,17 @@ "use strict"; | ||
? undefined | ||
: op.type === "boolean" | ||
: op.type === "BOOLEAN" | ||
? Boolean(args[index]) | ||
: op.type === "number" | ||
: op.type === "NUMBER" | ||
? Number(args[index]) | ||
: args[index]); | ||
: op.type === "USER" | ||
? message.channel.type === "DM" | ||
? args[index].replace(/\D/g, "") === message.client.user?.id | ||
? message.client.user | ||
: message.author | ||
: message.guild?.members.resolve(args[index].replace(/\D/g, "")) | ||
: op.type === "CHANNEL" | ||
? message.guild?.channels.resolve(args[index].replace(/\D/g, "")) | ||
: op.type === "ROLE" | ||
? message.guild?.roles.resolve(args[index].replace(/\D/g, "")) | ||
: args[index]); | ||
} | ||
@@ -100,0 +110,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { SimpleCommandType } from "../params/CommandParams"; | ||
import { Decorator } from "./Decorator"; | ||
@@ -8,8 +9,8 @@ export declare class DSimpleCommandOption extends Decorator { | ||
set name(value: string); | ||
get type(): "string" | "number" | "boolean"; | ||
set type(value: "string" | "number" | "boolean"); | ||
get type(): SimpleCommandType; | ||
set type(value: SimpleCommandType); | ||
get description(): string; | ||
set description(value: string); | ||
protected constructor(name: string, type?: "string" | "number" | "boolean", description?: string); | ||
static create(name: string, type?: "string" | "number" | "boolean", description?: string): DSimpleCommandOption; | ||
protected constructor(name: string, type?: SimpleCommandType, description?: string); | ||
static create(name: string, type?: SimpleCommandType, description?: string): DSimpleCommandOption; | ||
} |
@@ -10,3 +10,3 @@ "use strict"; | ||
this._description = description ?? `${name} - ${this.type}`; | ||
this._type = type ?? "string"; | ||
this._type = type ?? "STRING"; | ||
} | ||
@@ -13,0 +13,0 @@ get name() { |
import { ParameterDecoratorEx } from "../../types/public/decorators"; | ||
import { SimpleCommandType } from "../params/CommandParams"; | ||
/** | ||
@@ -18,3 +19,3 @@ * Define option for simple commnad | ||
description?: string; | ||
type?: "string" | "number" | "boolean"; | ||
type?: SimpleCommandType; | ||
}): ParameterDecoratorEx; |
@@ -11,1 +11,2 @@ import { Snowflake } from "discord.js"; | ||
} | ||
export declare type SimpleCommandType = "STRING" | "NUMBER" | "BOOLEAN" | "USER" | "CHANNEL" | "ROLE"; |
{ | ||
"name": "discordx", | ||
"version": "5.6.0-dev.1629062247.e02f3d8", | ||
"version": "5.6.0-dev.1629115384.3cd641c", | ||
"description": "Create your discord bot by using TypeScript and decorators!", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
224953
3589