mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
never ever come with snake_case again for dd
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import type { ApplicationCommandPermissions } from "../../../types/interactions/commands/application_command_permissions.ts";
|
||||
import { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guild_application_command_permissions.ts";
|
||||
import type { ApplicationCommandPermissions } from "../../../types/interactions/commands/applicationCommandPermissions.ts";
|
||||
import { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guildApplicationCommandPermissions.ts";
|
||||
|
||||
/** Batch edits permissions for all commands in a guild. Takes an array of partial GuildApplicationCommandPermissions objects including `id` and `permissions`. */
|
||||
export async function batchEditSlashCommandPermissions(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/application_command.ts";
|
||||
import type { CreateGlobalApplicationCommand } from "../../../types/interactions/commands/create_global_application_command.ts";
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/applicationCommand.ts";
|
||||
import type { CreateGlobalApplicationCommand } from "../../../types/interactions/commands/createGlobalApplicationCommand.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import { ApplicationCommandOption } from "../../../types/interactions/commands/application_command_option.ts";
|
||||
import { ApplicationCommandOption } from "../../../types/interactions/commands/applicationCommandOption.ts";
|
||||
|
||||
/**
|
||||
* There are two kinds of Slash Commands: global commands and guild commands. Global commands are available for every guild that adds your app; guild commands are specific to the guild you specify when making them. Command names are unique per application within each scope (global and guild). That means:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ApplicationCommandPermissions } from "../../../types/interactions/commands/application_command_permissions.ts";
|
||||
import type { ApplicationCommandPermissions } from "../../../types/interactions/commands/applicationCommandPermissions.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guild_application_command_permissions.ts";
|
||||
import { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guildApplicationCommandPermissions.ts";
|
||||
|
||||
/** Edits command permissions for a specific command for your application in a guild. */
|
||||
export async function editSlashCommandPermissions(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DiscordenoEditWebhookMessage } from "../../../types/discordeno/edit_webhook_message.ts";
|
||||
import type { DiscordenoEditWebhookMessage } from "../../../types/discordeno/editWebhookMessage.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import { DiscordAllowedMentionsTypes } from "../../../types/messages/allowed_mentions_types.ts";
|
||||
import { DiscordMessageComponentTypes } from "../../../types/messages/components/message_component_types.ts";
|
||||
import { AllowedMentionsTypes } from "../../../types/messages/allowedMentionsTypes.ts";
|
||||
import { MessageComponentTypes } from "../../../types/messages/components/messageComponentTypes.ts";
|
||||
|
||||
/** To edit your response to a slash command. If a messageId is not provided it will default to editing the original response. */
|
||||
export async function editSlashResponse(bot: Bot, token: string, options: DiscordenoEditWebhookMessage) {
|
||||
@@ -19,7 +19,7 @@ export async function editSlashResponse(bot: Bot, token: string, options: Discor
|
||||
|
||||
if (options.allowedMentions) {
|
||||
if (options.allowedMentions.users?.length) {
|
||||
if (options.allowedMentions.parse?.includes(DiscordAllowedMentionsTypes.UserMentions)) {
|
||||
if (options.allowedMentions.parse?.includes(AllowedMentionsTypes.UserMentions)) {
|
||||
options.allowedMentions.parse = options.allowedMentions.parse.filter((p) => p !== "users");
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export async function editSlashResponse(bot: Bot, token: string, options: Discor
|
||||
}
|
||||
|
||||
if (options.allowedMentions.roles?.length) {
|
||||
if (options.allowedMentions.parse?.includes(DiscordAllowedMentionsTypes.RoleMentions)) {
|
||||
if (options.allowedMentions.parse?.includes(AllowedMentionsTypes.RoleMentions)) {
|
||||
options.allowedMentions.parse = options.allowedMentions.parse.filter((p) => p !== "roles");
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export async function editSlashResponse(bot: Bot, token: string, options: Discor
|
||||
components: options.components?.map((component) => ({
|
||||
type: component.type,
|
||||
components: component.components.map((subcomponent) => {
|
||||
if (subcomponent.type === DiscordMessageComponentTypes.SelectMenu)
|
||||
if (subcomponent.type === MessageComponentTypes.SelectMenu)
|
||||
return {
|
||||
type: subcomponent.type,
|
||||
custom_id: subcomponent.customId,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/application_command.ts";
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/applicationCommand.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
|
||||
/** Fetches the global command for the given Id. If a guildId is provided, the guild command will be fetched. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guild_application_command_permissions.ts";
|
||||
import type { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guildApplicationCommandPermissions.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
|
||||
/** Fetches command permissions for a specific command for your application in a guild. Returns a GuildApplicationCommandPermissions object. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import type { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guild_application_command_permissions.ts";
|
||||
import type { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guildApplicationCommandPermissions.ts";
|
||||
|
||||
/** Fetches command permissions for all commands for your application in a guild. Returns an array of GuildApplicationCommandPermissions objects. */
|
||||
export async function getSlashCommandPermissions(bot: Bot, guildId: bigint) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/application_command.ts";
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/applicationCommand.ts";
|
||||
import { Collection } from "../../../util/collection.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/application_command.ts";
|
||||
import type { EditGlobalApplicationCommand } from "../../../types/interactions/commands/edit_global_application_command.ts";
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/applicationCommand.ts";
|
||||
import type { EditGlobalApplicationCommand } from "../../../types/interactions/commands/editGlobalApplicationCommand.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import { makeOptionsForCommand } from "./create_slash_command.ts";
|
||||
import { makeOptionsForCommand } from "./createSlashCommand.ts";
|
||||
|
||||
/**
|
||||
* Edit an existing slash command. If this command did not exist, it will create it.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/application_command.ts";
|
||||
import type { EditGlobalApplicationCommand } from "../../../types/interactions/commands/edit_global_application_command.ts";
|
||||
import type { ApplicationCommand } from "../../../types/interactions/commands/applicationCommand.ts";
|
||||
import type { EditGlobalApplicationCommand } from "../../../types/interactions/commands/editGlobalApplicationCommand.ts";
|
||||
import type { MakeRequired } from "../../../types/util.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Bot } from "../../../bot.ts";
|
||||
import { DiscordAllowedMentionsTypes } from "../../../types/messages/allowed_mentions_types.ts";
|
||||
import { DiscordMessageComponentTypes } from "../../../types/messages/components/message_component_types.ts";
|
||||
import { AllowedMentionsTypes } from "../../../types/messages/allowedMentionsTypes.ts";
|
||||
import { MessageComponentTypes } from "../../../types/messages/components/messageComponentTypes.ts";
|
||||
import { Message } from "../../../types/messages/message.ts";
|
||||
import { EditWebhookMessage } from "../../../types/webhooks/edit_webhook_message.ts";
|
||||
import { EditWebhookMessage } from "../../../types/webhooks/editWebhookMessage.ts";
|
||||
|
||||
/** Edits a followup message for an Interaction. Functions the same as edit webhook message, however this uses your interaction token instead of bot token. Does not support ephemeral followups. */
|
||||
export async function editFollowupMessage(
|
||||
@@ -21,7 +21,7 @@ export async function editFollowupMessage(
|
||||
|
||||
if (options.allowedMentions) {
|
||||
if (options.allowedMentions.users?.length) {
|
||||
if (options.allowedMentions.parse?.includes(DiscordAllowedMentionsTypes.UserMentions)) {
|
||||
if (options.allowedMentions.parse?.includes(AllowedMentionsTypes.UserMentions)) {
|
||||
options.allowedMentions.parse = options.allowedMentions.parse.filter((p) => p !== "users");
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export async function editFollowupMessage(
|
||||
}
|
||||
|
||||
if (options.allowedMentions.roles?.length) {
|
||||
if (options.allowedMentions.parse?.includes(DiscordAllowedMentionsTypes.RoleMentions)) {
|
||||
if (options.allowedMentions.parse?.includes(AllowedMentionsTypes.RoleMentions)) {
|
||||
options.allowedMentions.parse = options.allowedMentions.parse.filter((p) => p !== "roles");
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export async function editFollowupMessage(
|
||||
components: options.components?.map((component) => ({
|
||||
type: component.type,
|
||||
components: component.components.map((subcomponent) => {
|
||||
if (subcomponent.type === DiscordMessageComponentTypes.SelectMenu)
|
||||
if (subcomponent.type === MessageComponentTypes.SelectMenu)
|
||||
return {
|
||||
type: subcomponent.type,
|
||||
custom_id: subcomponent.customId,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DiscordenoInteractionResponse } from "../../types/discordeno/interaction_response.ts";
|
||||
import type { DiscordenoInteractionResponse } from "../../types/discordeno/interactionResponse.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { AllowedMentions } from "../../types/messages/allowed_mentions.ts";
|
||||
import { DiscordMessageComponentTypes } from "../../types/messages/components/message_component_types.ts";
|
||||
import { AllowedMentions } from "../../types/messages/allowedMentions.ts";
|
||||
import { MessageComponentTypes } from "../../types/messages/components/messageComponentTypes.ts";
|
||||
|
||||
/**
|
||||
* Send a response to a users slash command. The command data will have the id and token necessary to respond.
|
||||
@@ -102,7 +102,7 @@ export async function sendInteractionResponse(
|
||||
components: options.data.components?.map((component) => ({
|
||||
type: component.type,
|
||||
components: component.components.map((subcomponent) => {
|
||||
if (subcomponent.type === DiscordMessageComponentTypes.SelectMenu)
|
||||
if (subcomponent.type === MessageComponentTypes.SelectMenu)
|
||||
return {
|
||||
type: subcomponent.type,
|
||||
custom_id: subcomponent.customId,
|
||||
@@ -220,7 +220,7 @@ export async function sendInteractionResponse(
|
||||
components: options.data.components?.map((component) => ({
|
||||
type: component.type,
|
||||
components: component.components.map((subcomponent) => {
|
||||
if (subcomponent.type === DiscordMessageComponentTypes.SelectMenu)
|
||||
if (subcomponent.type === MessageComponentTypes.SelectMenu)
|
||||
return {
|
||||
type: subcomponent.type,
|
||||
custom_id: subcomponent.customId,
|
||||
|
||||
Reference in New Issue
Block a user