Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord-slash-commands-ru

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-slash-commands-ru - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

lib/cjs/index.d.ts
export { InteractionsClient as SlashClient } from "./listeners/Client";
export { ApplicationCommand, ApplicationCommandOption, ApplicationCommandOptionChoice, ApplicationCommandPermissions, ApplicationOptions, getCommandsOptions, GuildApplicationCommandPermissions, } from "./listeners/Interfaces";
export { ApplicationCommand, ApplicationCommandOption, ApplicationCommandOptionChoice, ApplicationOptions, getCommandsOptions, } from "./listeners/Interfaces";

@@ -1,2 +0,2 @@

import { ApplicationCommand, ApplicationCommandPermissions, ApplicationOptions, getCommandsOptions, GuildApplicationCommandPermissions } from "./Interfaces";
import { ApplicationCommand, ApplicationOptions, getCommandsOptions } from "./Interfaces";
export declare class InteractionsClient {

@@ -10,4 +10,2 @@ private token;

deleteSlashCommand(commandID: string, guildID?: string): Promise<boolean>;
getSlashCommandPermissions(guildID: string, commandID?: string): Promise<GuildApplicationCommandPermissions[] | GuildApplicationCommandPermissions>;
editSlashCommandPermissions(permissions: ApplicationCommandPermissions[], guildID: string, commandID: string): Promise<GuildApplicationCommandPermissions>;
}

@@ -96,33 +96,3 @@ "use strict";

}
getSlashCommandPermissions(guildID, commandID) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof guildID !== "string")
throw new Error("guildID must be of type string. Received: " + typeof guildID);
if (commandID && typeof commandID !== "string")
throw new Error("commandID received but wasn't of type string. received: " + typeof commandID);
const url = commandID
? `${apiUrl}/applications/${this.clientID}/guilds/${guildID}/commands/${commandID}/permissions`
: `${apiUrl}/applications/${this.clientID}/guilds/${guildID}/commands/permissions`;
const res = yield axios_1.default.get(url, {
headers: { Authorization: `Bot ${this.token}` },
});
return res.data;
});
}
editSlashCommandPermissions(permissions, guildID, commandID) {
return __awaiter(this, void 0, void 0, function* () {
if (!Array.isArray(permissions))
throw new Error("permissions must be of type array, but received: " + typeof permissions);
if (typeof guildID !== "string")
throw new Error("guildID must be of type string, but received: " + typeof guildID);
if (typeof commandID !== "string")
throw new Error("commandID must be of type string, but received: " + typeof commandID);
const url = `${apiUrl}/applications/${this.clientID}/guilds/${guildID}/commands/${commandID}/permissions`;
const res = yield axios_1.default.put(url, { permissions: permissions }, {
headers: { Authorization: `Bot ${this.token}` },
});
return res.data;
});
}
}
exports.InteractionsClient = InteractionsClient;

@@ -30,27 +30,1 @@ export interface getCommandsOptions {

}
/**
* Application command permissions allow you to enable or disable commands for specific users or roles within a guild.
* {@link https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissions Read the Discord docs}
*/
export interface ApplicationCommandPermissions {
/** Id of the role or user */
id: string;
/** The type of permission (1 = Role, 2 = User) */
type: 1 | 2;
/** `true` to allow, `false` to disallow */
permission: boolean;
}
/**
* Returned when fetching the permissions for a command in a guild.
* {@link https://discord.com/developers/docs/interactions/slash-commands#guildapplicationcommandpermissions See Discord docs}
*/
export interface GuildApplicationCommandPermissions {
/** Id of the command */
id: string;
/** Id of the application the command belongs to */
application_id: string;
/** Id of the guild */
guild_id: string;
/** Array of ApplicationCommandPermissions */
permissions: ApplicationCommandPermissions[];
}
export { InteractionsClient as SlashClient } from "./listeners/Client";
export { ApplicationCommand, ApplicationCommandOption, ApplicationCommandOptionChoice, ApplicationCommandPermissions, ApplicationOptions, getCommandsOptions, GuildApplicationCommandPermissions, } from "./listeners/Interfaces";
export { ApplicationCommand, ApplicationCommandOption, ApplicationCommandOptionChoice, ApplicationOptions, getCommandsOptions, } from "./listeners/Interfaces";

@@ -1,2 +0,2 @@

import { ApplicationCommand, ApplicationCommandPermissions, ApplicationOptions, getCommandsOptions, GuildApplicationCommandPermissions } from "./Interfaces";
import { ApplicationCommand, ApplicationOptions, getCommandsOptions } from "./Interfaces";
export declare class InteractionsClient {

@@ -10,4 +10,2 @@ private token;

deleteSlashCommand(commandID: string, guildID?: string): Promise<boolean>;
getSlashCommandPermissions(guildID: string, commandID?: string): Promise<GuildApplicationCommandPermissions[] | GuildApplicationCommandPermissions>;
editSlashCommandPermissions(permissions: ApplicationCommandPermissions[], guildID: string, commandID: string): Promise<GuildApplicationCommandPermissions>;
}

@@ -90,32 +90,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

}
getSlashCommandPermissions(guildID, commandID) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof guildID !== "string")
throw new Error("guildID must be of type string. Received: " + typeof guildID);
if (commandID && typeof commandID !== "string")
throw new Error("commandID received but wasn't of type string. received: " + typeof commandID);
const url = commandID
? `${apiUrl}/applications/${this.clientID}/guilds/${guildID}/commands/${commandID}/permissions`
: `${apiUrl}/applications/${this.clientID}/guilds/${guildID}/commands/permissions`;
const res = yield axios.get(url, {
headers: { Authorization: `Bot ${this.token}` },
});
return res.data;
});
}
editSlashCommandPermissions(permissions, guildID, commandID) {
return __awaiter(this, void 0, void 0, function* () {
if (!Array.isArray(permissions))
throw new Error("permissions must be of type array, but received: " + typeof permissions);
if (typeof guildID !== "string")
throw new Error("guildID must be of type string, but received: " + typeof guildID);
if (typeof commandID !== "string")
throw new Error("commandID must be of type string, but received: " + typeof commandID);
const url = `${apiUrl}/applications/${this.clientID}/guilds/${guildID}/commands/${commandID}/permissions`;
const res = yield axios.put(url, { permissions: permissions }, {
headers: { Authorization: `Bot ${this.token}` },
});
return res.data;
});
}
}

@@ -30,27 +30,1 @@ export interface getCommandsOptions {

}
/**
* Application command permissions allow you to enable or disable commands for specific users or roles within a guild.
* {@link https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissions Read the Discord docs}
*/
export interface ApplicationCommandPermissions {
/** Id of the role or user */
id: string;
/** The type of permission (1 = Role, 2 = User) */
type: 1 | 2;
/** `true` to allow, `false` to disallow */
permission: boolean;
}
/**
* Returned when fetching the permissions for a command in a guild.
* {@link https://discord.com/developers/docs/interactions/slash-commands#guildapplicationcommandpermissions See Discord docs}
*/
export interface GuildApplicationCommandPermissions {
/** Id of the command */
id: string;
/** Id of the application the command belongs to */
application_id: string;
/** Id of the guild */
guild_id: string;
/** Array of ApplicationCommandPermissions */
permissions: ApplicationCommandPermissions[];
}
{
"name": "discord-slash-commands-ru",
"version": "1.1.3",
"version": "1.1.4",
"description": "Модуль с русским переводом для Дискорд ботов, чтобы легко создать слеш-команды и управлять ими.",

@@ -24,2 +24,6 @@ "main": "./lib/cjs/index.js",

"author": "HellLover",
"bugs": {
"url": "https://github.com/HellLover/discord-slash-commands-ru/issues"
},
"homepage": "https://github.com/HellLover/discord-slash-commands-ru#readme",
"license": "ISC",

@@ -26,0 +30,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc