From e812ac6b62b184ef39a1491d19377f8c2b07fb61 Mon Sep 17 00:00:00 2001 From: POPPIN-FUMI Date: Mon, 13 Nov 2023 18:17:29 +0100 Subject: [PATCH] update: release v0.2.9 --- dist/lib/deployCommands.d.ts | 2 +- dist/lib/version.d.ts | 2 +- docs/functions/addRoleToUser.html | 2 +- docs/functions/createPrivateChannel.html | 2 +- docs/functions/createTextChannel.html | 2 +- docs/functions/deferResponse.html | 2 +- docs/functions/deleteChannel.html | 2 +- docs/functions/deployCommands.html | 4 ++-- docs/functions/discordChangeLog.html | 2 +- docs/functions/getGuildMembers.html | 2 +- docs/functions/getReleaseInfoAsJson.html | 2 +- docs/functions/getUserRoles.html | 2 +- docs/functions/isChannelExist.html | 2 +- docs/functions/messageChannel.html | 2 +- docs/functions/removeUserRole.html | 2 +- docs/functions/updateResponse.html | 2 +- docs/interfaces/DiscordUser.html | 4 ++-- docs/interfaces/GuildMember.html | 4 ++-- docs/types/ReleaseInfo.html | 2 +- package.json | 2 +- src/lib/version.ts | 2 +- 21 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dist/lib/deployCommands.d.ts b/dist/lib/deployCommands.d.ts index 70e6664..48a120c 100644 --- a/dist/lib/deployCommands.d.ts +++ b/dist/lib/deployCommands.d.ts @@ -35,4 +35,4 @@ import { SlashCommandBuilder } from 'discord.js'; * .catch((error) => console.error(error)); * ``` */ -export declare function deployCommands(token: string, discordClientId: string, guildId: string, commands: SlashCommandBuilder[]): Promise; +export declare function deployCommands(token: string, discordClientId: string, guildId: string, commands: Omit): Promise; diff --git a/dist/lib/version.d.ts b/dist/lib/version.d.ts index 090f307..f05ea50 100644 --- a/dist/lib/version.d.ts +++ b/dist/lib/version.d.ts @@ -1 +1 @@ -export declare const VERSION = "0.2.8"; +export declare const VERSION = "0.2.9"; diff --git a/docs/functions/addRoleToUser.html b/docs/functions/addRoleToUser.html index f4d493d..658e925 100644 --- a/docs/functions/addRoleToUser.html +++ b/docs/functions/addRoleToUser.html @@ -6,4 +6,4 @@

Throws

Will throw an error if there is a problem adding the role.

Example

const token = 'your_discord_token_here';
const guildId = 'your_guild_id_here';
const userId = 'your_user_id_here';
const roleId = 'your_role_id_here';

const run = async () => {
try {
await addRoleToUser(token, guildId, userId, roleId);
console.log('Role added successfully.');
} catch (error) {
console.error(`Error: ${error.message}`);
}
}

run();
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/createPrivateChannel.html b/docs/functions/createPrivateChannel.html index efd562d..e549c24 100644 --- a/docs/functions/createPrivateChannel.html +++ b/docs/functions/createPrivateChannel.html @@ -7,4 +7,4 @@

Throws

Will throw an error if there is a problem creating the channel.

Example

const token = 'your_discord_token_here';
const guildId = 'your_guild_id_here';
const channelName = 'private-channel';
const memberId = 'your_member_id_here';

const channel = await createPrivateChannel(token, guildId, channelName, memberId)

if (channel) {
console.log(`Channel created with ID: ${channel.id}`);
} else {
console.log('Channel already exists.');
}
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/createTextChannel.html b/docs/functions/createTextChannel.html index d216b1f..562c59c 100644 --- a/docs/functions/createTextChannel.html +++ b/docs/functions/createTextChannel.html @@ -7,4 +7,4 @@

Throws

Will throw an error if there is a problem creating the channel.

Example

const token = 'your_discord_token_here';
const guildId = 'your_guild_id_here';
const channelName = 'text-channel';
const memberId = 'your_member_id_here';

const channel = await createTextChannel(token, guildId, channelName, memberId)
console.log(`Channel created with ID: ${channel.id}`)
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/deferResponse.html b/docs/functions/deferResponse.html index 0c063de..377a4bb 100644 --- a/docs/functions/deferResponse.html +++ b/docs/functions/deferResponse.html @@ -7,4 +7,4 @@

Throws

Will throw an error if there is a problem deferring the response.

Example

const token = 'your_discord_token_here';
const interactionId = 'your_interaction_id_here';
const interactionToken = 'your_interaction_token_here';
const content = 'Please wait...';

deferResponse(token, interactionId, interactionToken, content)
.then(success => {
if (success) {
console.log('Response deferred successfully.');
} else {
console.log('Failed to defer the response.');
}
})
.catch(error => console.error(`Error: ${error.message}`));
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/deleteChannel.html b/docs/functions/deleteChannel.html index e896d76..3ba608a 100644 --- a/docs/functions/deleteChannel.html +++ b/docs/functions/deleteChannel.html @@ -4,4 +4,4 @@

Throws

Will throw an error if there is a problem deleting the channel.

Example

const token = 'your_discord_token_here'
const channelId = 'your_channel_id_here'

const run = async () => {
try {
await deleteChannel(token, channelId)
console.log('Channel deleted successfully.')
} catch (error) {
console.error(`Error: ${error.message}`)
}
}

run()
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/deployCommands.html b/docs/functions/deployCommands.html index 723d6d3..5d02b85 100644 --- a/docs/functions/deployCommands.html +++ b/docs/functions/deployCommands.html @@ -4,9 +4,9 @@

Parameters

  • token: string

    The token used for authentication with the Discord API.

  • discordClientId: string

    The Discord client ID.

  • guildId: string

    The ID of the guild where commands are being deployed.

    -
  • commands: SlashCommandBuilder[]

    An array of SlashCommandBuilder representing the commands to be deployed.

    +
  • commands: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">

    An array of SlashCommandBuilder representing the commands to be deployed.

Returns Promise<void>

A promise that resolves when commands are successfully deployed.

Throws

Will throw an error if there is a problem with the deployment.

Example

import { commands } from "./commands";
import { deployCommands } from "@skeet-framework/discord-utils";
import { DISCORD_APPLICATION_ID, DISCORD_GUILD_ID } from "../config";

const commandsData = Object.values(commands).map((command) => command.data);

const run = async () => {
const token = process.argv[2] || '';
try {
await deployCommands(token, DISCORD_APPLICATION_ID, DISCORD_GUILD_ID, commandsData);
console.log('Commands deployed successfully.');
} catch (error) {
console.error(`Error deploying commands: ${error}`);
}
};

run()
.then(() => console.log('Done'))
.catch((error) => console.error(error));
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/discordChangeLog.html b/docs/functions/discordChangeLog.html index 09705f8..a2d8816 100644 --- a/docs/functions/discordChangeLog.html +++ b/docs/functions/discordChangeLog.html @@ -1 +1 @@ -discordChangeLog | @skeet-framework/discord-utils
  • Parameters

    • discordToken: string
    • repoName: string
    • channelIds: string[]
    • lang: string = ''

    Returns Promise<string>

Generated using TypeDoc

\ No newline at end of file +discordChangeLog | @skeet-framework/discord-utils
  • Parameters

    • discordToken: string
    • repoName: string
    • channelIds: string[]
    • lang: string = ''

    Returns Promise<string>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/getGuildMembers.html b/docs/functions/getGuildMembers.html index edbf0fd..0ded6dc 100644 --- a/docs/functions/getGuildMembers.html +++ b/docs/functions/getGuildMembers.html @@ -7,4 +7,4 @@

Throws

Will throw an error if the REST call fails.

Example

import dotenv from 'dotenv'
import { getGuildMembers } from './path-to-this-file'
dotenv.config()

const token = process.env.DISCORD_TOKEN as string
const guildId = process.env.DISCORD_GUILD_ID as string

const run = async () => {
try {
const members = await getGuildMembers(token, guildId)
console.log(`Retrieved ${members.length} members`)
} catch (error) {
console.error(error)
}
}

void run()
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/getReleaseInfoAsJson.html b/docs/functions/getReleaseInfoAsJson.html index 9a4909a..799c1ac 100644 --- a/docs/functions/getReleaseInfoAsJson.html +++ b/docs/functions/getReleaseInfoAsJson.html @@ -1 +1 @@ -getReleaseInfoAsJson | @skeet-framework/discord-utils

Generated using TypeDoc

\ No newline at end of file +getReleaseInfoAsJson | @skeet-framework/discord-utils

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/getUserRoles.html b/docs/functions/getUserRoles.html index d4132da..6a2576b 100644 --- a/docs/functions/getUserRoles.html +++ b/docs/functions/getUserRoles.html @@ -6,4 +6,4 @@

Throws

Will throw an error if there is a problem retrieving the user's roles.

Example

const token = 'your_discord_token_here';
const guildId = 'your_guild_id_here';
const userId = 'your_user_id_here';

const run = async () => {
try {
const roles = await getUserRoles(token, guildId, userId);
console.log('User roles:', roles);
} catch (error) {
console.error(`Error: ${error.message}`);
}
}

run();
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/isChannelExist.html b/docs/functions/isChannelExist.html index 4de5fc2..aa25547 100644 --- a/docs/functions/isChannelExist.html +++ b/docs/functions/isChannelExist.html @@ -6,4 +6,4 @@

Throws

Will throw an error if the REST API call fails.

Example

const token = 'your_discord_token_here';
const guildId = 'your_guild_id_here';
const channelName = 'general';

isChannelExist(token, guildId, channelName)
.then(exists => console.log(exists ? 'Channel exists.' : 'Channel does not exist.'))
.catch(error => console.error(`Error: ${error.message}`));
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/messageChannel.html b/docs/functions/messageChannel.html index 1419925..121e085 100644 --- a/docs/functions/messageChannel.html +++ b/docs/functions/messageChannel.html @@ -6,4 +6,4 @@

Throws

Will throw an error if there is a problem sending the message.

Example

const token = 'your_discord_token_here';
const channelId = 'your_channel_id_here';
const body = {
content: 'Hello, world!',
};

const run = async () => {
try {
const message = await messageChannel(token, channelId, body);
console.log(`Message sent with ID: ${message.id}`);
} catch (error) {
console.error(`Error: ${error.message}`);
}
}

run();
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/removeUserRole.html b/docs/functions/removeUserRole.html index 7bd4a52..8e8fbe0 100644 --- a/docs/functions/removeUserRole.html +++ b/docs/functions/removeUserRole.html @@ -7,4 +7,4 @@

Throws

Will throw an error if there is a problem removing the role.

Example

const token = 'your_discord_token_here';
const guildId = 'your_guild_id_here';
const userId = 'your_user_id_here';
const roleId = 'your_role_id_here';

const run = async () => {
try {
await removeUserRole(token, guildId, userId, roleId);
console.log('Role removed successfully.');
} catch (error) {
console.error(`Error: ${error.message}`);
}
}

run();
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/updateResponse.html b/docs/functions/updateResponse.html index 6296ed2..44f1b21 100644 --- a/docs/functions/updateResponse.html +++ b/docs/functions/updateResponse.html @@ -7,4 +7,4 @@

Throws

Will throw an error if there is a problem updating the response.

Example

const token = 'your_discord_token_here';
const applicationId = 'your_application_id_here';
const interactionToken = 'your_interaction_token_here';
const data = {
content: 'Updated response!',
};

const run = async () => {
try {
const success = await updateResponse(token, applicationId, interactionToken, data);
if (success) {
console.log('Response updated successfully.');
} else {
console.log('Failed to update the response.');
}
} catch (error) {
console.error(`Error: ${error.message}`);
}
}

run();
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/DiscordUser.html b/docs/interfaces/DiscordUser.html index 95716be..9ae4f87 100644 --- a/docs/interfaces/DiscordUser.html +++ b/docs/interfaces/DiscordUser.html @@ -1,4 +1,4 @@ -DiscordUser | @skeet-framework/discord-utils

Hierarchy

  • DiscordUser

Properties

accent_color +DiscordUser | @skeet-framework/discord-utils

Hierarchy

  • DiscordUser

Properties

accent_color: null | string
avatar: string
avatar_decoration_data: any
banner: null | string
banner_color: null | string
discriminator: string
flags: number
global_name: string
id: string
premium_type: number
public_flags: number
username: string

Generated using TypeDoc

\ No newline at end of file +

Properties

accent_color: null | string
avatar: string
avatar_decoration_data: any
banner: null | string
banner_color: null | string
discriminator: string
flags: number
global_name: string
id: string
premium_type: number
public_flags: number
username: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/GuildMember.html b/docs/interfaces/GuildMember.html index d72a6f1..02d1a7a 100644 --- a/docs/interfaces/GuildMember.html +++ b/docs/interfaces/GuildMember.html @@ -1,4 +1,4 @@ -GuildMember | @skeet-framework/discord-utils

Hierarchy

  • GuildMember

Properties

avatar +GuildMember | @skeet-framework/discord-utils

Hierarchy

  • GuildMember

Properties

avatar: null | string
communication_disabled_until: null | string
deaf: boolean
flags: number
joined_at: string
mute: boolean
nick: null | string
pending: boolean
premium_since: null | string
roles: string[]
unusual_dm_activity_until: null | string

Generated using TypeDoc

\ No newline at end of file +

Properties

avatar: null | string
communication_disabled_until: null | string
deaf: boolean
flags: number
joined_at: string
mute: boolean
nick: null | string
pending: boolean
premium_since: null | string
roles: string[]
unusual_dm_activity_until: null | string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/ReleaseInfo.html b/docs/types/ReleaseInfo.html index f68b078..4c9751a 100644 --- a/docs/types/ReleaseInfo.html +++ b/docs/types/ReleaseInfo.html @@ -1 +1 @@ -ReleaseInfo | @skeet-framework/discord-utils
ReleaseInfo: {
    author: string;
    created: string;
    draft: boolean;
    prerelease: boolean;
    published: string;
    tag: string;
    url: string;
    whatsChanged: string;
}

Type declaration

  • author: string
  • created: string
  • draft: boolean
  • prerelease: boolean
  • published: string
  • tag: string
  • url: string
  • whatsChanged: string

Generated using TypeDoc

\ No newline at end of file +ReleaseInfo | @skeet-framework/discord-utils
ReleaseInfo: {
    author: string;
    created: string;
    draft: boolean;
    prerelease: boolean;
    published: string;
    tag: string;
    url: string;
    whatsChanged: string;
}

Type declaration

  • author: string
  • created: string
  • draft: boolean
  • prerelease: boolean
  • published: string
  • tag: string
  • url: string
  • whatsChanged: string

Generated using TypeDoc

\ No newline at end of file diff --git a/package.json b/package.json index fa16a0a..92752e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skeet-framework/discord-utils", - "version": "0.2.8", + "version": "0.2.9", "description": "Skeet Framework Plugin - Discord Utils", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/lib/version.ts b/src/lib/version.ts index ee74d26..bc7aa3f 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -1 +1 @@ -export const VERSION = '0.2.8' \ No newline at end of file +export const VERSION = '0.2.9' \ No newline at end of file