mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-15 19:08:17 +00:00
never ever come with snake_case again for dd
This commit is contained in:
@@ -69,10 +69,10 @@ export interface User {
|
||||
/** The user's email */
|
||||
email?: string | null;
|
||||
/** The flags on a user's account */
|
||||
flags?: DiscordUserFlags;
|
||||
flags?: UserFlags;
|
||||
/** The type of Nitro subscription on a user's account */
|
||||
premiumType?: DiscordPremiumTypes;
|
||||
premiumType?: PremiumTypes;
|
||||
/** The public flags on a user's account */
|
||||
publicFlags?: DiscordUserFlags;
|
||||
publicFlags?: UserFlags;
|
||||
}
|
||||
```
|
||||
|
||||
+13
-15
@@ -11,8 +11,8 @@ import {
|
||||
simplifyUrl,
|
||||
} from "./rest/mod.ts";
|
||||
import type { RestPayload, RestRateLimitedPath, RestRequest } from "./rest/rest.ts";
|
||||
import { DiscordGatewayIntents, Intents } from "./types/gateway/gateway_intents.ts";
|
||||
import { GetGatewayBot } from "./types/gateway/get_gateway_bot.ts";
|
||||
import { GatewayIntents, Intents } from "./types/gateway/gatewayIntents.ts";
|
||||
import { GetGatewayBot } from "./types/gateway/getGatewayBot.ts";
|
||||
import { bigintToSnowflake, snowflakeToBigint } from "./util/bigint.ts";
|
||||
import { Collection } from "./util/collection.ts";
|
||||
import {
|
||||
@@ -42,7 +42,7 @@ import {
|
||||
USER_AGENT,
|
||||
} from "./util/constants.ts";
|
||||
import { Errors } from "./types/discordeno/errors.ts";
|
||||
import { DiscordGatewayPayload, GatewayDispatchEventNames, GatewayPayload } from "./types/gateway/gateway_payload.ts";
|
||||
import { DiscordGatewayPayload, GatewayDispatchEventNames, GatewayPayload } from "./types/gateway/gatewayPayload.ts";
|
||||
import {
|
||||
closeWS,
|
||||
handleOnMessage,
|
||||
@@ -57,7 +57,7 @@ import {
|
||||
DiscordenoShard,
|
||||
processGatewayQueue,
|
||||
} from "./ws/mod.ts";
|
||||
import { validateLength } from "./util/validate_length.ts";
|
||||
import { validateLength } from "./util/validateLength.ts";
|
||||
import {
|
||||
delay,
|
||||
formatImageURL,
|
||||
@@ -68,7 +68,7 @@ import {
|
||||
validateSlashOptions,
|
||||
} from "./util/utils.ts";
|
||||
import { iconBigintToHash, iconHashToBigInt } from "./util/hash.ts";
|
||||
import { calculateShardId } from "./util/calculate_shard_id.ts";
|
||||
import { calculateShardId } from "./util/calculateShardId.ts";
|
||||
import * as handlers from "./handlers/mod.ts";
|
||||
import { DiscordenoInteraction, transformInteraction } from "./transformers/interaction.ts";
|
||||
import { DiscordenoIntegration, transformIntegration } from "./transformers/integration.ts";
|
||||
@@ -81,7 +81,7 @@ import { DiscordenoEmoji, transformEmoji } from "./transformers/emoji.ts";
|
||||
import { transformActivity } from "./transformers/activity.ts";
|
||||
import { DiscordenoPresence, transformPresence } from "./transformers/presence.ts";
|
||||
import { DiscordReady } from "./types/gateway/ready.ts";
|
||||
import { urlToBase64 } from "./util/url_to_base64.ts";
|
||||
import { urlToBase64 } from "./util/urlToBase64.ts";
|
||||
import { transformAttachment } from "./transformers/attachment.ts";
|
||||
import { transformEmbed } from "./transformers/embed.ts";
|
||||
import { transformComponent } from "./transformers/component.ts";
|
||||
@@ -90,7 +90,7 @@ import { transformThread } from "./transformers/thread.ts";
|
||||
import { transformWebhook } from "./transformers/webhook.ts";
|
||||
import { transformAuditlogEntry } from "./transformers/auditlogEntry.ts";
|
||||
import { transformApplicationCommandPermission } from "./transformers/applicationCommandPermission.ts";
|
||||
import { StatusUpdate } from "./types/gateway/status_update.ts";
|
||||
import { StatusUpdate } from "./types/gateway/statusUpdate.ts";
|
||||
import { calculateBits, calculatePermissions } from "./util/permissions.ts";
|
||||
|
||||
type CacheOptions =
|
||||
@@ -113,7 +113,7 @@ export function createBot<C extends CacheOptions = CacheOptions>(
|
||||
applicationId: options.applicationId || options.botId,
|
||||
token: `Bot ${options.token}`,
|
||||
events: createEventHandlers(options.events),
|
||||
intents: options.intents.reduce((bits, next) => (bits |= DiscordGatewayIntents[next]), 0),
|
||||
intents: options.intents.reduce((bits, next) => (bits |= GatewayIntents[next]), 0),
|
||||
botGatewayData: options.botGatewayData,
|
||||
activeGuildIds: new Set<bigint>(),
|
||||
constants: createBotConstants(),
|
||||
@@ -125,7 +125,7 @@ export function createBot<C extends CacheOptions = CacheOptions>(
|
||||
// @ts-ignore itoh cache types plz
|
||||
bot.cache = createCache(bot as Bot, options.cache);
|
||||
|
||||
return bot as unknown as Bot<C extends { isAsync: true } ? AsyncCache : Cache>;
|
||||
return (bot as unknown) as Bot<C extends { isAsync: true } ? AsyncCache : Cache>;
|
||||
}
|
||||
|
||||
export function createEventHandlers(events: Partial<EventHandlers>): EventHandlers {
|
||||
@@ -372,7 +372,7 @@ export function createGatewayManager(
|
||||
$device: options.$device ?? "Discordeno",
|
||||
intents:
|
||||
(Array.isArray(options.intents)
|
||||
? options.intents.reduce((bits, next) => (bits |= DiscordGatewayIntents[next]), 0)
|
||||
? options.intents.reduce((bits, next) => (bits |= GatewayIntents[next]), 0)
|
||||
: options.intents) ?? 0,
|
||||
shard: options.shard ?? [0, options.shardsRecommended ?? 1],
|
||||
urlWSS: options.urlWSS ?? "wss://gateway.discord.gg/?v=9&encoding=json",
|
||||
@@ -419,7 +419,7 @@ export interface CreateBotOptions<C extends CacheOptions = CacheOptions> {
|
||||
botId: bigint;
|
||||
applicationId?: bigint;
|
||||
events: Partial<EventHandlers>;
|
||||
intents: (keyof typeof DiscordGatewayIntents)[];
|
||||
intents: (keyof typeof GatewayIntents)[];
|
||||
botGatewayData?: GetGatewayBot;
|
||||
rest?: Omit<CreateRestManagerOptions, "token">;
|
||||
handleDiscordPayload?: GatewayManager["handleDiscordPayload"];
|
||||
@@ -443,7 +443,7 @@ export interface Bot<C extends Cache | AsyncCache = AsyncCache | Cache> {
|
||||
applicationId: bigint;
|
||||
|
||||
token: string;
|
||||
intents: DiscordGatewayIntents;
|
||||
intents: GatewayIntents;
|
||||
urlWSS: string;
|
||||
botGatewayData?: GetGatewayBot;
|
||||
utils: ReturnType<typeof createUtils>;
|
||||
@@ -466,7 +466,6 @@ export interface Helpers {
|
||||
addReactions: typeof helpers.addReactions;
|
||||
addRole: typeof helpers.addRole;
|
||||
avatarURL: typeof helpers.avatarURL;
|
||||
ban: typeof helpers.ban;
|
||||
banMember: typeof helpers.banMember;
|
||||
batchEditSlashCommandPermissions: typeof helpers.batchEditSlashCommandPermissions;
|
||||
channelOverwriteHasPermission: typeof helpers.channelOverwriteHasPermission;
|
||||
@@ -632,7 +631,6 @@ export function createBaseHelpers(options: Partial<Helpers>) {
|
||||
addReactions: options.addReactions || helpers.addReactions,
|
||||
addRole: options.addRole || helpers.addRole,
|
||||
avatarURL: options.avatarURL || helpers.avatarURL,
|
||||
ban: options.ban || helpers.ban,
|
||||
banMember: options.banMember || helpers.banMember,
|
||||
batchEditSlashCommandPermissions:
|
||||
options.batchEditSlashCommandPermissions || helpers.batchEditSlashCommandPermissions,
|
||||
@@ -865,7 +863,7 @@ export interface GatewayManager {
|
||||
$os: string;
|
||||
$browser: string;
|
||||
$device: string;
|
||||
intents: number | (keyof typeof DiscordGatewayIntents)[];
|
||||
intents: number | (keyof typeof GatewayIntents)[];
|
||||
shard: [number, number];
|
||||
presence?: Omit<StatusUpdate, "afk" | "since">;
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import type { DiscordenoGuild } from "./transformers/guild.ts";
|
||||
import type { DiscordenoMember, DiscordenoUser } from "./transformers/member.ts";
|
||||
import type { DiscordenoMessage } from "./transformers/message.ts";
|
||||
import { DiscordenoPresence } from "./transformers/presence.ts";
|
||||
import { GuildMember } from "./types/members/guild_member.ts";
|
||||
import { GuildMember } from "./types/members/guildMember.ts";
|
||||
import { Collection } from "./util/collection.ts";
|
||||
|
||||
function messageSweeper(bot: Bot, message: DiscordenoMessage) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Channel } from "../../types/channels/channel.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Channel } from "../../types/channels/channel.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { ChannelPinsUpdate } from "../../types/channels/channel_pins_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { ChannelPinsUpdate } from "../../types/channels/channelPinsUpdate.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleChannelPinsUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { Channel } from "../../types/channels/channel.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleChannelUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { StageInstance } from "../../types/channels/stage_instance.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { StageInstance } from "../../types/channels/stageInstance.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleStageInstanceCreate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { StageInstance } from "../../types/channels/stage_instance.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { StageInstance } from "../../types/channels/stageInstance.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleStageInstanceDelete(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { StageInstance } from "../../types/channels/stage_instance.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { StageInstance } from "../../types/channels/stageInstance.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleStageInstanceUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import { Channel } from "../../types/channels/channel.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleThreadCreate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
export async function handleThreadCreate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
const payload = data.d as SnakeCasedPropertiesDeep<Channel>;
|
||||
|
||||
// bot.events.threadCreate(bot, payload);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// import { eventHandlers } from "../../bot.ts";
|
||||
// import { cacheHandlers } from "../../cache.ts";
|
||||
import { Channel } from "../../types/channels/channel.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { snowflakeToBigint } from "../../util/bigint.ts";
|
||||
|
||||
export async function handleThreadDelete(data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// import { eventHandlers } from "../../bot.ts";
|
||||
// import { cacheHandlers } from "../../cache.ts";
|
||||
import { ThreadListSync } from "../../types/channels/threads/thread_list_sync.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import { ThreadListSync } from "../../types/channels/threads/threadListSync.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { snowflakeToBigint } from "../../util/bigint.ts";
|
||||
// import { channelToThread } from "../../util/transformers/channel_to_thread.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// import { eventHandlers } from "../../bot.ts";
|
||||
// import { cacheHandlers } from "../../cache.ts";
|
||||
import { ThreadMembersUpdate } from "../../types/channels/threads/thread_members_update.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import { ThreadMembersUpdate } from "../../types/channels/threads/threadMembersUpdate.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { snowflakeToBigint } from "../../util/bigint.ts";
|
||||
// import { threadMembersUpdateModified } from "../../util/transformers/thread_members_update_modified.ts";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// import { eventHandlers } from "../../bot.ts";
|
||||
// import { cacheHandlers } from "../../cache.ts";
|
||||
import { ThreadMember } from "../../types/channels/threads/thread_member.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import { ThreadMember } from "../../types/channels/threads/threadMember.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { snowflakeToBigint } from "../../util/bigint.ts";
|
||||
|
||||
export async function handleThreadMemberUpdate(data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// import { eventHandlers } from "../../bot.ts";
|
||||
// import { cacheHandlers } from "../../cache.ts";
|
||||
import { Channel } from "../../types/channels/channel.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { snowflakeToBigint } from "../../util/bigint.ts";
|
||||
// import { channelToThread } from "../../util/transformers/channel_to_thread.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { GuildEmojisUpdate } from "../../types/emojis/guild_emojis_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildEmojisUpdate } from "../../types/emojis/guildEmojisUpdate.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildBanAddRemove } from "../../types/guilds/guild_ban_add_remove.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildBanAddRemove } from "../../types/guilds/guildBanAddRemove.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildBanAdd(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildBanAddRemove } from "../../types/guilds/guild_ban_add_remove.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildBanAddRemove } from "../../types/guilds/guildBanAddRemove.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildBanRemove(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { Guild } from "../../types/guilds/guild.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { UnavailableGuild } from "../../types/guilds/unavailable_guild.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { UnavailableGuild } from "../../types/guilds/unavailableGuild.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildDelete(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildIntegrationsUpdate } from "../../types/integrations/guild_integrations_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildIntegrationsUpdate } from "../../types/integrations/guildIntegrationsUpdate.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildIntegrationsUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { Guild } from "../../types/guilds/guild.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { Guild } from "../../types/guilds/guild.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { IntegrationCreateUpdate } from "../../types/integrations/integration_create_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { IntegrationCreateUpdate } from "../../types/integrations/integrationCreateUpdate.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleIntegrationCreate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { IntegrationDelete } from "../../types/integrations/integration_delete.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { IntegrationDelete } from "../../types/integrations/integrationDelete.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleIntegrationDelete(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { IntegrationCreateUpdate } from "../../types/integrations/integration_create_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { IntegrationCreateUpdate } from "../../types/integrations/integrationCreateUpdate.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleIntegrationUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { Interaction } from "../../types/interactions/interaction.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { InviteCreate } from "../../types/invites/invite_create.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { InviteCreate } from "../../types/invites/inviteCreate.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleInviteCreate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { InviteDelete } from "../../types/invites/invite_delete.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { InviteDelete } from "../../types/invites/inviteDelete.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleInviteDelete(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import { statusTypes } from "../../transformers/presence.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildMembersChunk } from "../../types/members/guild_members_chunk.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildMembersChunk } from "../../types/members/guildMembersChunk.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildMembersChunk(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildMemberAdd } from "../../types/members/guild_member_add.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildMemberAdd } from "../../types/members/guildMemberAdd.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildMemberAdd(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildMemberRemove } from "../../types/members/guild_member_remove.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildMemberRemove } from "../../types/members/guildMemberRemove.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
import { snowflakeToBigint } from "../../util/bigint.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildMemberUpdate } from "../../types/members/guild_member_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildMemberUpdate } from "../../types/members/guildMemberUpdate.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildMemberUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { Message } from "../../types/messages/message.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { MessageDelete } from "../../types/messages/message_delete.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { MessageDelete } from "../../types/messages/messageDelete.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleMessageDelete(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { MessageDeleteBulk } from "../../types/messages/message_delete_bulk.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { MessageDeleteBulk } from "../../types/messages/messageDeleteBulk.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleMessageDeleteBulk(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { MessageReactionAdd } from "../../types/messages/message_reaction_add.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { MessageReactionAdd } from "../../types/messages/messageReactionAdd.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleMessageReactionAdd(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot, } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { MessageReactionRemove } from "../../types/messages/message_reaction_remove.ts";
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { MessageReactionRemove } from "../../types/messages/messageReactionRemove.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleMessageReactionRemove(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { MessageReactionRemoveAll } from "../../types/messages/message_reaction_remove_all.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { MessageReactionRemoveAll } from "../../types/messages/messageReactionRemoveAll.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleMessageReactionRemoveAll(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { MessageReactionRemoveEmoji } from "../../types/messages/message_reaction_remove_emoji.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { MessageReactionRemoveEmoji } from "../../types/messages/messageReactionRemoveEmoji.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleMessageReactionRemoveEmoji(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { Message } from "../../types/messages/message.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { PresenceUpdate } from "../../types/activity/presence_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { PresenceUpdate } from "../../types/activity/presenceUpdate.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handlePresenceUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { DiscordReady } from "../../types/gateway/ready.ts";
|
||||
|
||||
export function handleReady(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { TypingStart } from "../../types/misc/typing_start.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { TypingStart } from "../../types/misc/typingStart.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export function handleTypingStart(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { User } from "../../types/users/user.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildRoleCreate } from "../../types/guilds/guild_role_create.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildRoleCreate } from "../../types/guilds/guildRoleCreate.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildRoleCreate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildRoleDelete } from "../../types/guilds/guild_role_delete.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildRoleDelete } from "../../types/guilds/guildRoleDelete.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildRoleDelete(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { GuildRoleUpdate } from "../../types/guilds/guild_role_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { GuildRoleUpdate } from "../../types/guilds/guildRoleUpdate.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
export async function handleGuildRoleUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { VoiceServerUpdate } from "../../types/voice/voice_server_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { VoiceServerUpdate } from "../../types/voice/voiceServerUpdate.ts";
|
||||
|
||||
export async function handleVoiceServerUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
const payload = data.d as SnakeCasedPropertiesDeep<VoiceServerUpdate>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { VoiceState } from "../../types/voice/voice_state.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { VoiceState } from "../../types/voice/voiceState.ts";
|
||||
import { Bot } from "../../bot.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import type { WebhookUpdate } from "../../types/webhooks/webhooks_update.ts";
|
||||
import type { DiscordGatewayPayload } from "../../types/gateway/gatewayPayload.ts";
|
||||
import type { WebhookUpdate } from "../../types/webhooks/webhooksUpdate.ts";
|
||||
import { Bot } from "../../bot.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { separateOverwrites } from "../../transformers/channel.ts";
|
||||
import type { DiscordOverwrite } from "../../types/channels/overwrite.ts";
|
||||
import { DiscordBitwisePermissionFlags } from "../../types/permissions/bitwise_permission_flags.ts";
|
||||
import type { PermissionStrings } from "../../types/permissions/permission_strings.ts";
|
||||
import { BitwisePermissionFlags } from "../../types/permissions/bitwisePermissionFlags.ts";
|
||||
import type { PermissionStrings } from "../../types/permissions/permissionStrings.ts";
|
||||
|
||||
/** Checks if a channel overwrite for a user id or a role id has permission in this channel */
|
||||
export function channelOverwriteHasPermission(
|
||||
@@ -24,10 +24,10 @@ export function channelOverwriteHasPermission(
|
||||
|
||||
return permissions.every((perm) => {
|
||||
const [type, id, allowBits, denyBits] = separateOverwrites(overwrite);
|
||||
if (BigInt(denyBits) & BigInt(DiscordBitwisePermissionFlags[perm])) {
|
||||
if (BigInt(denyBits) & BigInt(BitwisePermissionFlags[perm])) {
|
||||
return false;
|
||||
}
|
||||
if (BigInt(allowBits) & BigInt(DiscordBitwisePermissionFlags[perm])) {
|
||||
if (BigInt(allowBits) & BigInt(BitwisePermissionFlags[perm])) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { DiscordenoChannel, separateOverwrites } from "../../transformers/channel.ts";
|
||||
import type { CreateGuildChannel } from "../../types/guilds/create_guild_channel.ts";
|
||||
import type { CreateGuildChannel } from "../../types/guilds/createGuildChannel.ts";
|
||||
|
||||
/** Create a copy of a channel */
|
||||
export async function cloneChannel(bot: Bot, channel: DiscordenoChannel, reason?: string) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Channel } from "../../types/channels/channel.ts";
|
||||
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||
import type { CreateGuildChannel, DiscordCreateGuildChannel } from "../../types/guilds/create_guild_channel.ts";
|
||||
import { ChannelTypes } from "../../types/channels/channelTypes.ts";
|
||||
import type { CreateGuildChannel, DiscordCreateGuildChannel } from "../../types/guilds/createGuildChannel.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Create a channel in your server. Bot needs MANAGE_CHANNEL permissions in the server. */
|
||||
@@ -28,7 +28,7 @@ export async function createChannel(bot: Bot, guildId: bigint, options?: CreateG
|
||||
allow: perm.allow ? bot.utils.calculateBits(perm.allow) : "0",
|
||||
deny: perm.deny ? bot.utils.calculateBits(perm.deny) : "0",
|
||||
})),
|
||||
type: options?.type || DiscordChannelTypes.GuildText,
|
||||
type: options?.type || ChannelTypes.GuildText,
|
||||
reason,
|
||||
}
|
||||
: {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { StageInstance } from "../../types/channels/stage_instance.ts";
|
||||
import type { StageInstance } from "../../types/channels/stageInstance.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { PrivacyLevel } from "../../types/channels/privacy_level.ts";
|
||||
import { PrivacyLevel } from "../../types/channels/privacyLevel.ts";
|
||||
|
||||
/** Creates a new Stage instance associated to a Stage channel. Requires the user to be a moderator of the Stage channel. */
|
||||
export async function createStageInstance(bot: Bot, channelId: bigint, topic: string, privacyLevel?: PrivacyLevel) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Channel } from "../../types/channels/channel.ts";
|
||||
import type { ModifyChannel } from "../../types/channels/modify_channel.ts";
|
||||
import type { ModifyChannel } from "../../types/channels/modifyChannel.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { DiscordenoChannel } from "../../transformers/channel.ts";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FollowedChannel } from "../../types/channels/followed_channel.ts";
|
||||
import type { FollowedChannel } from "../../types/channels/followedChannel.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Follow a News Channel to send messages to a target channel. Requires the `MANAGE_WEBHOOKS` permission in the target channel. Returns the webhook id. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { StageInstance } from "../../types/channels/stage_instance.ts";
|
||||
import type { StageInstance } from "../../types/channels/stageInstance.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Gets the stage instance associated with the Stage channel, if it exists. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||
import { ChannelTypes } from "../../types/channels/channelTypes.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ModifyGuildChannelPositions } from "../../types/guilds/modify_guild_channel_position.ts";
|
||||
import type { ModifyGuildChannelPositions } from "../../types/guilds/modifyGuildChannelPosition.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Modify the positions of channels on the guild. Requires MANAGE_CHANNELS permission. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ModifyThread } from "../../../types/channels/threads/modify_thread.ts";
|
||||
import type { ModifyThread } from "../../../types/channels/threads/modifyThread.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
// import { channelToThread } from "../../../util/transformers/channel_to_thread.ts";
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import type { ListActiveThreads } from "../../../types/channels/threads/list_active_threads.ts";
|
||||
import type { ListActiveThreads } from "../../../types/channels/threads/listActiveThreads.ts";
|
||||
import { Collection } from "../../../util/collection.ts";
|
||||
// import { channelToThread } from "../../../util/transformers/channel_to_thread.ts";
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { ListActiveThreads } from "../../../types/channels/threads/list_active_threads.ts";
|
||||
import { ListPublicArchivedThreads } from "../../../types/channels/threads/list_public_archived_threads.ts";
|
||||
import { PermissionStrings } from "../../../types/permissions/permission_strings.ts";
|
||||
import { ListActiveThreads } from "../../../types/channels/threads/listActiveThreads.ts";
|
||||
import { ListPublicArchivedThreads } from "../../../types/channels/threads/listPublicArchivedThreads.ts";
|
||||
import { PermissionStrings } from "../../../types/permissions/permissionStrings.ts";
|
||||
import { Collection } from "../../../util/collection.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
// import { channelToThread } from "../../../util/transformers/channel_to_thread.ts";
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import { ThreadMember } from "../../../types/channels/threads/thread_member.ts";
|
||||
import { ThreadMember } from "../../../types/channels/threads/threadMember.ts";
|
||||
|
||||
/** Returns thread members objects that are members of the thread. */
|
||||
export async function getThreadMember(bot: Bot, threadId: bigint, userId: bigint) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import { ThreadMember } from "../../../types/channels/threads/thread_member.ts";
|
||||
import { ThreadMember } from "../../../types/channels/threads/threadMember.ts";
|
||||
|
||||
/** Returns thread members objects that are members of the thread. */
|
||||
export async function getThreadMembers(bot: Bot, threadId: bigint) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
export * from "./add_to_thread.ts";
|
||||
export * from "./archive_thread.ts";
|
||||
export * from "./delete_thread.ts";
|
||||
export * from "./edit_thread.ts";
|
||||
export * from "./get_active_threads.ts";
|
||||
export * from "./get_archived_threads.ts";
|
||||
export * from "./get_thread_members.ts";
|
||||
export * from "./join_thread.ts";
|
||||
export * from "./leave_thread.ts";
|
||||
export * from "./lock_thread.ts";
|
||||
export * from "./remove_thread_member.ts";
|
||||
export * from "./start_private_thread.ts";
|
||||
export * from "./start_thread.ts";
|
||||
export * from "./unarchive_thread.ts";
|
||||
export * from "./unlock_thread.ts";
|
||||
export * from "./addToThread.ts";
|
||||
export * from "./archiveThread.ts";
|
||||
export * from "./deleteThread.ts";
|
||||
export * from "./editThread.ts";
|
||||
export * from "./getActiveThreads.ts";
|
||||
export * from "./getArchivedThreads.ts";
|
||||
export * from "./getThreadMembers.ts";
|
||||
export * from "./joinThread.ts";
|
||||
export * from "./leaveThread.ts";
|
||||
export * from "./lockThread.ts";
|
||||
export * from "./removeThreadMember.ts";
|
||||
export * from "./startThreadWithoutMessage.ts";
|
||||
export * from "./startThreadWithMessage.ts";
|
||||
export * from "./unarchiveThread.ts";
|
||||
export * from "./unlockThread.ts";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Channel } from "../../../types/channels/channel.ts";
|
||||
import type { StartThreadWithMessage } from "../../../types/channels/threads/start_thread.ts";
|
||||
import type { StartThreadWithMessage } from "../../../types/channels/threads/startThread.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
|
||||
/** Creates a new public thread from an existing message. Returns a thread channel. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Channel } from "../../../types/channels/channel.ts";
|
||||
import type { StartThreadWithoutMessage } from "../../../types/channels/threads/start_thread.ts";
|
||||
import type { StartThreadWithoutMessage } from "../../../types/channels/threads/startThread.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
|
||||
/** Creates a new private thread. Returns a thread channel. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UpdateOthersVoiceState } from "../../types/guilds/update_others_voice_state.ts";
|
||||
import type { UpdateSelfVoiceState } from "../../types/guilds/update_self_voice_state.ts";
|
||||
import type { UpdateOthersVoiceState } from "../../types/guilds/updateOthersVoiceState.ts";
|
||||
import type { UpdateSelfVoiceState } from "../../types/guilds/updateSelfVoiceState.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { StageInstance } from "../../types/channels/stage_instance.ts";
|
||||
import type { StageInstance } from "../../types/channels/stageInstance.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { ChannelTypes } from "../../types/channels/channel_types.ts";
|
||||
import { ChannelTypes } from "../../types/channels/channelTypes.ts";
|
||||
|
||||
/** Updates fields of an existing Stage instance. Requires the user to be a moderator of the Stage channel. */
|
||||
export async function updateStageInstance(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AddGuildDiscoverySubcategory } from "../../types/discovery/add_guild_discovery_subcategory.ts";
|
||||
import type { AddGuildDiscoverySubcategory } from "../../types/discovery/addGuildDiscoverySubcategory.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Add a discovery subcategory to the guild. Requires the `MANAGE_GUILD` permission. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscoveryMetadata } from "../../types/discovery/discovery_metadata.ts";
|
||||
import type { ModifyGuildDiscoveryMetadata } from "../../types/discovery/modify_guild_discovery_metadata.ts";
|
||||
import type { DiscoveryMetadata } from "../../types/discovery/discoveryMetadata.ts";
|
||||
import type { ModifyGuildDiscoveryMetadata } from "../../types/discovery/modifyGuildDiscoveryMetadata.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Modify the discovery metadata for the guild. Requires the MANAGE_GUILD permission. Returns the updated discovery metadata object on success. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DiscoveryCategory } from "../../types/discovery/discovery_category.ts";
|
||||
import type { DiscoveryCategory } from "../../types/discovery/discoveryCategory.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DiscoveryMetadata } from "../../types/discovery/discovery_metadata.ts";
|
||||
import type { DiscoveryMetadata } from "../../types/discovery/discoveryMetadata.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Returns the discovery metadata object for the guild. Requires the `MANAGE_GUILD` permission. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ValidateDiscoverySearchTerm } from "../../types/discovery/validate_discovery_search_term.ts";
|
||||
import type { ValidateDiscoverySearchTerm } from "../../types/discovery/validateDiscoverySearchTerm.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CreateGuildEmoji } from "../../types/emojis/create_guild_emoji.ts";
|
||||
import type { CreateGuildEmoji } from "../../types/emojis/createGuildEmoji.ts";
|
||||
import type { Emoji } from "../../types/emojis/emoji.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Emoji } from "../../types/emojis/emoji.ts";
|
||||
import type { ModifyGuildEmoji } from "../../types/emojis/modify_guild_emoji.ts";
|
||||
import type { ModifyGuildEmoji } from "../../types/emojis/modifyGuildEmoji.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Modify the given emoji. Requires the MANAGE_EMOJIS permission. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CreateGuild } from "../../types/guilds/create_guild.ts";
|
||||
import type { CreateGuild } from "../../types/guilds/createGuild.ts";
|
||||
import type { Guild } from "../../types/guilds/guild.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { Guild } from "../../types/guilds/guild.ts";
|
||||
import type { ModifyGuild } from "../../types/guilds/modify_guild.ts";
|
||||
import type { ModifyGuild } from "../../types/guilds/modifyGuild.ts";
|
||||
|
||||
/** Modify a guilds settings. Requires the MANAGE_GUILD permission. */
|
||||
export async function editGuild(bot: Bot, guildId: bigint, options: ModifyGuild, shardId: number) {
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
import type { ModifyGuildWelcomeScreen } from "../../types/guilds/modify_guild_welcome_screen.ts";
|
||||
import type { WelcomeScreen } from "../../types/guilds/welcome_screen.ts";
|
||||
import type { ModifyGuildWelcomeScreen } from "../../types/guilds/modifyGuildWelcomeScreen.ts";
|
||||
import type { WelcomeScreen } from "../../types/guilds/welcomeScreen.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
export async function editWelcomeScreen(bot: Bot, guildId: bigint, options: ModifyGuildWelcomeScreen) {
|
||||
return await bot.rest.runMethod<WelcomeScreen>(bot.rest, "patch", bot.constants.endpoints.GUILD_WELCOME_SCREEN(guildId), {
|
||||
enabled: options.enabled,
|
||||
welcomeScreen: options.welcomeScreen?.map((welcomeScreen) => {
|
||||
return {
|
||||
channel_id: welcomeScreen.channelId,
|
||||
description: welcomeScreen.description,
|
||||
emoji_id: welcomeScreen.emojiId,
|
||||
emoji_name: welcomeScreen.emojiName,
|
||||
};
|
||||
}),
|
||||
description: options.description,
|
||||
});
|
||||
return await bot.rest.runMethod<WelcomeScreen>(
|
||||
bot.rest,
|
||||
"patch",
|
||||
bot.constants.endpoints.GUILD_WELCOME_SCREEN(guildId),
|
||||
{
|
||||
enabled: options.enabled,
|
||||
welcomeScreen: options.welcomeScreen?.map((welcomeScreen) => {
|
||||
return {
|
||||
channel_id: welcomeScreen.channelId,
|
||||
description: welcomeScreen.description,
|
||||
emoji_id: welcomeScreen.emojiId,
|
||||
emoji_name: welcomeScreen.emojiName,
|
||||
};
|
||||
}),
|
||||
description: options.description,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GuildWidget } from "../../types/guilds/guild_widget.ts";
|
||||
import type { GuildWidget } from "../../types/guilds/guildWidget.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Modify a guild widget object for the guild. Requires the MANAGE_GUILD permission. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { AuditLog } from "../../types/audit_log/audit_log.ts";
|
||||
import type { GetGuildAuditLog } from "../../types/audit_log/get_guild_audit_log.ts";
|
||||
import type { AuditLog } from "../../types/auditLog/auditLog.ts";
|
||||
import type { GetGuildAuditLog } from "../../types/auditLog/getGuildAuditLog.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Returns the audit logs for the guild. Requires VIEW AUDIT LOGS permission */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { VoiceRegion } from "../../types/voice/voice_region.ts";
|
||||
import type { VoiceRegion } from "../../types/voice/voiceRegion.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Returns an array of voice regions that can be used when creating servers. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GuildPreview } from "../../types/guilds/guild_preview.ts";
|
||||
import type { GuildPreview } from "../../types/guilds/guildPreview.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Returns the guild preview object for the given id. If the bot is not in the guild, then the guild must be Discoverable. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GetGuildPruneCountQuery } from "../../types/guilds/get_guild_prune_count.ts";
|
||||
import type { GetGuildPruneCountQuery } from "../../types/guilds/getGuildPruneCount.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Check how many members would be removed from the server in a prune operation. Requires the KICK_MEMBERS permission */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { InviteMetadata } from "../../types/invites/invite_metadata.ts";
|
||||
import type { InviteMetadata } from "../../types/invites/inviteMetadata.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Returns the code and uses of the vanity url for this server if it is enabled else `code` will be null. Requires the `MANAGE_GUILD` permission. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { VoiceRegion } from "../../types/voice/voice_region.ts";
|
||||
import type { VoiceRegion } from "../../types/voice/voiceRegion.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { WelcomeScreen } from "../../types/guilds/welcome_screen.ts";
|
||||
import type { WelcomeScreen } from "../../types/guilds/welcomeScreen.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
export async function getWelcomeScreen(bot: Bot, guildId: bigint) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GuildWidgetDetails } from "../../types/guilds/guild_widget_details.ts";
|
||||
import type { GuildWidgetDetails } from "../../types/guilds/guildWidgetDetails.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Returns the widget for the guild. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { GetGuildWidgetImageQuery } from "../../types/guilds/get_guild_widget_image.ts";
|
||||
import type { GetGuildWidgetImageQuery } from "../../types/guilds/getGuildWidgetImage.ts";
|
||||
|
||||
/** Returns the widget image URL for the guild. */
|
||||
export async function getWidgetImageURL(bot: Bot, guildId: bigint, options?: GetGuildWidgetImageQuery) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GuildWidget } from "../../types/guilds/guild_widget.ts";
|
||||
import type { GuildWidget } from "../../types/guilds/guildWidget.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Returns the guild widget object. Requires the MANAGE_GUILD permission. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordImageFormat } from "../../types/misc/image_format.ts";
|
||||
import type { DiscordImageSize } from "../../types/misc/image_size.ts";
|
||||
import type { ImageFormat } from "../../types/misc/imageFormat.ts";
|
||||
import type { ImageSize } from "../../types/misc/imageSize.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** The full URL of the banner from Discords CDN. Undefined if no banner is set. */
|
||||
@@ -8,8 +8,8 @@ export function guildBannerURL(
|
||||
id: bigint,
|
||||
options: {
|
||||
banner?: string | bigint;
|
||||
size?: DiscordImageSize;
|
||||
format?: DiscordImageFormat;
|
||||
size?: ImageSize;
|
||||
format?: ImageFormat;
|
||||
}
|
||||
) {
|
||||
return options.banner
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordImageFormat } from "../../types/misc/image_format.ts";
|
||||
import type { DiscordImageSize } from "../../types/misc/image_size.ts";
|
||||
import type { ImageFormat } from "../../types/misc/imageFormat.ts";
|
||||
import type { ImageSize } from "../../types/misc/imageSize.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** The full URL of the icon from Discords CDN. Undefined when no icon is set. */
|
||||
@@ -8,8 +8,8 @@ export function guildIconURL(
|
||||
id: bigint,
|
||||
options: {
|
||||
icon?: string | bigint;
|
||||
size?: DiscordImageSize;
|
||||
format?: DiscordImageFormat;
|
||||
size?: ImageSize;
|
||||
format?: ImageFormat;
|
||||
}
|
||||
) {
|
||||
return options.icon
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordImageFormat } from "../../types/misc/image_format.ts";
|
||||
import type { DiscordImageSize } from "../../types/misc/image_size.ts";
|
||||
import type { ImageFormat } from "../../types/misc/imageFormat.ts";
|
||||
import type { ImageSize } from "../../types/misc/imageSize.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** The full URL of the splash from Discords CDN. Undefined if no splash is set. */
|
||||
@@ -8,17 +8,15 @@ export function guildSplashURL(
|
||||
id: bigint,
|
||||
options: {
|
||||
splash?: string | bigint;
|
||||
size?: DiscordImageSize;
|
||||
format?: DiscordImageFormat;
|
||||
size?: ImageSize;
|
||||
format?: ImageFormat;
|
||||
}
|
||||
) {
|
||||
return options.splash
|
||||
? bot.utils.formatImageURL(
|
||||
bot.constants.endpoints.GUILD_SPLASH(
|
||||
id,
|
||||
typeof options.splash === "string"
|
||||
? options.splash
|
||||
: bot.utils.iconBigintToHash(options.splash)
|
||||
typeof options.splash === "string" ? options.splash : bot.utils.iconBigintToHash(options.splash)
|
||||
),
|
||||
options.size || 128,
|
||||
options.format
|
||||
|
||||
@@ -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(
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user