i tried
This commit is contained in:
parent
a8c9c2e7e0
commit
d829c91c3e
87 changed files with 357 additions and 324 deletions
|
@ -79,4 +79,4 @@ export { commands, client }
|
|||
export * from './src/types/slash.ts'
|
||||
export * from './src/structures/slash.ts'
|
||||
export * from './src/interactions/mod.ts'
|
||||
export * from './src/types/channel.ts'
|
||||
// export * from './src/types/channel.ts'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/method-signature-style */
|
||||
import { User } from '../structures/user.ts'
|
||||
import type { User } from '../structures/user.ts'
|
||||
import { GatewayIntents } from '../types/gateway.ts'
|
||||
import { Gateway } from '../gateway/mod.ts'
|
||||
import { RESTManager, RESTOptions, TokenType } from '../rest/mod.ts'
|
||||
|
@ -22,7 +22,7 @@ import type { Collector } from './collectors.ts'
|
|||
import { HarmonyEventEmitter } from '../utils/events.ts'
|
||||
import type { VoiceRegion } from '../types/voice.ts'
|
||||
import { fetchAuto } from '../../deps.ts'
|
||||
import { DMChannel } from '../structures/dmChannel.ts'
|
||||
import type { DMChannel } from '../structures/dmChannel.ts'
|
||||
import { Template } from '../structures/template.ts'
|
||||
|
||||
/** OS related properties sent with Gateway Identify */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Message } from '../structures/message.ts'
|
||||
import { GuildTextBasedChannel } from '../structures/guildTextChannel.ts'
|
||||
import type { Message } from '../structures/message.ts'
|
||||
import type { GuildTextBasedChannel } from '../structures/guildTextChannel.ts'
|
||||
import { Client, ClientOptions } from '../client/mod.ts'
|
||||
import {
|
||||
CategoriesManager,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Guild } from '../structures/guild.ts'
|
||||
import { Message } from '../structures/message.ts'
|
||||
import { TextChannel } from '../structures/textChannel.ts'
|
||||
import { User } from '../structures/user.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import type { Message } from '../structures/message.ts'
|
||||
import type { TextChannel } from '../structures/textChannel.ts'
|
||||
import type { User } from '../structures/user.ts'
|
||||
import { Collection } from '../utils/collection.ts'
|
||||
import type { CommandClient } from './client.ts'
|
||||
import type { Extension } from './extension.ts'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Collection } from '../utils/collection.ts'
|
||||
import { Command } from './command.ts'
|
||||
import { CommandClient } from './client.ts'
|
||||
import { ClientEvents } from '../gateway/handlers/mod.ts'
|
||||
import type { ClientEvents } from '../gateway/handlers/mod.ts'
|
||||
|
||||
export type ExtensionEventCallback = (ext: Extension, ...args: any[]) => any
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
import getChannelByType from '../../utils/getChannelByType.ts'
|
||||
import { ChannelPayload, GuildChannelPayload } from '../../types/channel.ts'
|
||||
import { Guild } from '../../structures/guild.ts'
|
||||
import type {
|
||||
ChannelPayload,
|
||||
GuildChannelPayload
|
||||
} from '../../types/channel.ts'
|
||||
import type { Guild } from '../../structures/guild.ts'
|
||||
|
||||
export const channelCreate: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
import { ChannelPayload } from '../../types/channel.ts'
|
||||
import type { ChannelPayload } from '../../types/channel.ts'
|
||||
|
||||
export const channelDelete: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import { ChannelPinsUpdatePayload } from '../../types/gateway.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { ChannelPinsUpdatePayload } from '../../types/gateway.ts'
|
||||
|
||||
export const channelPinsUpdate: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Channel } from '../../structures/channel.ts'
|
||||
import { ChannelPayload } from '../../types/channel.ts'
|
||||
import type { Channel } from '../../structures/channel.ts'
|
||||
import type { ChannelPayload } from '../../types/channel.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const channelUpdate: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Message } from '../../structures/message.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
import { User } from '../../structures/user.ts'
|
||||
import { MessagePayload } from '../../types/channel.ts'
|
||||
import type { MessagePayload } from '../../types/channel.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const messageCreate: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import { MessageDeletePayload } from '../../types/gateway.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { MessageDeletePayload } from '../../types/gateway.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const messageDelete: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Message } from '../../structures/message.ts'
|
||||
import { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts'
|
||||
import { MessageDeleteBulkPayload } from '../../types/gateway.ts'
|
||||
import type { Message } from '../../structures/message.ts'
|
||||
import type { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts'
|
||||
import type { MessageDeleteBulkPayload } from '../../types/gateway.ts'
|
||||
import { Collection } from '../../utils/collection.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
import { MessageReactionAddPayload } from '../../types/gateway.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import { MessageReaction } from '../../structures/messageReaction.ts'
|
||||
import { UserPayload } from '../../types/user.ts'
|
||||
import type { MessageReactionAddPayload } from '../../types/gateway.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { MessageReaction } from '../../structures/messageReaction.ts'
|
||||
import type { UserPayload } from '../../types/user.ts'
|
||||
|
||||
export const messageReactionAdd: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
import { MessageReactionRemovePayload } from '../../types/gateway.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { MessageReactionRemovePayload } from '../../types/gateway.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
|
||||
export const messageReactionRemove: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
import { MessageReactionRemoveAllPayload } from '../../types/gateway.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { MessageReactionRemoveAllPayload } from '../../types/gateway.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
|
||||
export const messageReactionRemoveAll: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
import { MessageReactionRemoveEmojiPayload } from '../../types/gateway.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { MessageReactionRemoveEmojiPayload } from '../../types/gateway.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
|
||||
export const messageReactionRemoveEmoji: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Message } from '../../structures/message.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import { MessagePayload } from '../../types/channel.ts'
|
||||
import type { Message } from '../../structures/message.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { MessagePayload } from '../../types/channel.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const messageUpdate: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { GatewayEventHandler } from '../mod.ts'
|
||||
import {
|
||||
import type {
|
||||
GatewayEvents,
|
||||
MessageDeletePayload,
|
||||
TypingStartGuildData
|
||||
|
@ -31,18 +31,18 @@ import { webhooksUpdate } from './webhooksUpdate.ts'
|
|||
import { messageDeleteBulk } from './messageDeleteBulk.ts'
|
||||
import { userUpdate } from './userUpdate.ts'
|
||||
import { typingStart } from './typingStart.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
import { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts'
|
||||
import { Guild } from '../../structures/guild.ts'
|
||||
import { User } from '../../structures/user.ts'
|
||||
import { Emoji } from '../../structures/emoji.ts'
|
||||
import { Member } from '../../structures/member.ts'
|
||||
import { Role } from '../../structures/role.ts'
|
||||
import { Message } from '../../structures/message.ts'
|
||||
import { Collection } from '../../utils/collection.ts'
|
||||
import type { Guild } from '../../structures/guild.ts'
|
||||
import type { User } from '../../structures/user.ts'
|
||||
import type { Emoji } from '../../structures/emoji.ts'
|
||||
import type { Member } from '../../structures/member.ts'
|
||||
import type { Role } from '../../structures/role.ts'
|
||||
import type { Message } from '../../structures/message.ts'
|
||||
import type { Collection } from '../../utils/collection.ts'
|
||||
import { voiceServerUpdate } from './voiceServerUpdate.ts'
|
||||
import { voiceStateUpdate } from './voiceStateUpdate.ts'
|
||||
import { VoiceState } from '../../structures/voiceState.ts'
|
||||
import type { VoiceState } from '../../structures/voiceState.ts'
|
||||
import { messageReactionAdd } from './messageReactionAdd.ts'
|
||||
import { messageReactionRemove } from './messageReactionRemove.ts'
|
||||
import { messageReactionRemoveAll } from './messageReactionRemoveAll.ts'
|
||||
|
@ -51,23 +51,23 @@ import { guildMembersChunk } from './guildMembersChunk.ts'
|
|||
import { presenceUpdate } from './presenceUpdate.ts'
|
||||
import { inviteCreate } from './inviteCreate.ts'
|
||||
import { inviteDelete } from './inviteDelete.ts'
|
||||
import { MessageReaction } from '../../structures/messageReaction.ts'
|
||||
import { Invite } from '../../structures/invite.ts'
|
||||
import { Presence } from '../../structures/presence.ts'
|
||||
import {
|
||||
import type { MessageReaction } from '../../structures/messageReaction.ts'
|
||||
import type { Invite } from '../../structures/invite.ts'
|
||||
import type { Presence } from '../../structures/presence.ts'
|
||||
import type {
|
||||
EveryChannelTypes,
|
||||
EveryTextChannelTypes
|
||||
} from '../../utils/getChannelByType.ts'
|
||||
import { interactionCreate } from './interactionCreate.ts'
|
||||
import { Interaction } from '../../structures/slash.ts'
|
||||
import { CommandContext } from '../../commands/command.ts'
|
||||
import { RequestMethods } from '../../rest/types.ts'
|
||||
import { PartialInvitePayload } from '../../types/invite.ts'
|
||||
import { GuildChannels } from '../../types/guild.ts'
|
||||
import type { Interaction } from '../../structures/slash.ts'
|
||||
import type { CommandContext } from '../../commands/command.ts'
|
||||
import type { RequestMethods } from '../../rest/types.ts'
|
||||
import type { PartialInvitePayload } from '../../types/invite.ts'
|
||||
import type { GuildChannels } from '../../types/guild.ts'
|
||||
import { applicationCommandCreate } from './applicationCommandCreate.ts'
|
||||
import { applicationCommandDelete } from './applicationCommandDelete.ts'
|
||||
import { applicationCommandUpdate } from './applicationCommandUpdate.ts'
|
||||
import { SlashCommand } from '../../interactions/slashCommand.ts'
|
||||
import type { SlashCommand } from '../../interactions/slashCommand.ts'
|
||||
|
||||
export const gatewayHandlers: {
|
||||
[eventCode in GatewayEvents]: GatewayEventHandler | undefined
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { PresenceUpdatePayload } from '../../types/gateway.ts'
|
||||
import type { PresenceUpdatePayload } from '../../types/gateway.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const presenceUpdate: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { User } from '../../structures/user.ts'
|
||||
import { Ready } from '../../types/gateway.ts'
|
||||
import { GuildPayload } from '../../types/guild.ts'
|
||||
import type { Ready } from '../../types/gateway.ts'
|
||||
import type { GuildPayload } from '../../types/guild.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const ready: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { User } from '../../structures/user.ts'
|
||||
import { CLIENT_USER } from '../../types/endpoint.ts'
|
||||
import { Resume } from '../../types/gateway.ts'
|
||||
import type { Resume } from '../../types/gateway.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const resume: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Member } from '../../structures/member.ts'
|
||||
import { TextChannel } from '../../structures/textChannel.ts'
|
||||
import { TypingStartPayload } from '../../types/gateway.ts'
|
||||
import type { TextChannel } from '../../structures/textChannel.ts'
|
||||
import type { TypingStartPayload } from '../../types/gateway.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
// TODO: Do we need to add uncached events here?
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { User } from '../../structures/user.ts'
|
||||
import { UserPayload } from '../../types/user.ts'
|
||||
import type { User } from '../../structures/user.ts'
|
||||
import type { UserPayload } from '../../types/user.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const userUpdate: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Guild } from '../../structures/guild.ts'
|
||||
import { VoiceServerUpdatePayload } from '../../types/gateway.ts'
|
||||
import type { Guild } from '../../structures/guild.ts'
|
||||
import type { VoiceServerUpdatePayload } from '../../types/gateway.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const voiceServerUpdate: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Guild } from '../../structures/guild.ts'
|
||||
import { VoiceState } from '../../structures/voiceState.ts'
|
||||
import { MemberPayload } from '../../types/guild.ts'
|
||||
import { VoiceStatePayload } from '../../types/voice.ts'
|
||||
import type { Guild } from '../../structures/guild.ts'
|
||||
import type { VoiceState } from '../../structures/voiceState.ts'
|
||||
import type { MemberPayload } from '../../types/guild.ts'
|
||||
import type { VoiceStatePayload } from '../../types/voice.ts'
|
||||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
|
||||
export const voiceStateUpdate: GatewayEventHandler = async (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { Gateway, GatewayEventHandler } from '../mod.ts'
|
||||
import { Guild } from '../../structures/guild.ts'
|
||||
import { WebhooksUpdatePayload } from '../../types/gateway.ts'
|
||||
import { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts'
|
||||
import type { Guild } from '../../structures/guild.ts'
|
||||
import type { WebhooksUpdatePayload } from '../../types/gateway.ts'
|
||||
import type { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts'
|
||||
|
||||
export const webhooksUpdate: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { unzlib } from '../../deps.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { GatewayResponse } from '../types/gatewayResponse.ts'
|
||||
import {
|
||||
GatewayOpcodes,
|
||||
|
@ -11,8 +11,8 @@ import {
|
|||
import { gatewayHandlers } from './handlers/mod.ts'
|
||||
import { GatewayCache } from '../managers/gatewayCache.ts'
|
||||
import { delay } from '../utils/delay.ts'
|
||||
import { VoiceChannel } from '../structures/guildVoiceChannel.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import type { VoiceChannel } from '../structures/guildVoiceChannel.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import { HarmonyEventEmitter } from '../utils/events.ts'
|
||||
import { decodeText } from '../utils/encoding.ts'
|
||||
import { Constants } from '../types/constants.ts'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { RESTManager } from '../rest/manager.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import {
|
||||
SlashCommandChoice,
|
||||
SlashCommandOption,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { SlashCommandHandler } from './slashClient.ts'
|
||||
import type { SlashCommandHandler } from './slashClient.ts'
|
||||
|
||||
export class SlashModule {
|
||||
name: string = ''
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Collection } from '../utils/collection.ts'
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Collection } from '../utils/collection.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ import { Client } from '../client/mod.ts'
|
|||
import { Channel } from '../structures/channel.ts'
|
||||
import { Embed } from '../structures/embed.ts'
|
||||
import { Message } from '../structures/message.ts'
|
||||
import { TextChannel } from '../structures/textChannel.ts'
|
||||
import {
|
||||
import type { TextChannel } from '../structures/textChannel.ts'
|
||||
import type {
|
||||
ChannelPayload,
|
||||
GuildChannelPayload,
|
||||
MessageOptions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Emoji } from '../structures/emoji.ts'
|
||||
import { EmojiPayload } from '../types/emoji.ts'
|
||||
import type { EmojiPayload } from '../types/emoji.ts'
|
||||
import { GUILD_EMOJI } from '../types/endpoint.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
|
||||
/**
|
||||
* Cache Manager used for Caching values related to Gateway connection
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { BaseChildManager } from './baseChild.ts'
|
||||
import { VoiceStatePayload } from '../types/voice.ts'
|
||||
import type { VoiceStatePayload } from '../types/voice.ts'
|
||||
import { VoiceState } from '../structures/voiceState.ts'
|
||||
import { GuildVoiceStatesManager } from './guildVoiceStates.ts'
|
||||
import { VoiceChannel } from '../structures/guildVoiceChannel.ts'
|
||||
import type { VoiceChannel } from '../structures/guildVoiceChannel.ts'
|
||||
|
||||
export class GuildChannelVoiceStatesManager extends BaseChildManager<
|
||||
VoiceStatePayload,
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Channel } from '../structures/channel.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import { CategoryChannel } from '../structures/guildCategoryChannel.ts'
|
||||
import type { CategoryChannel } from '../structures/guildCategoryChannel.ts'
|
||||
import {
|
||||
ChannelTypes,
|
||||
GuildChannelPayload,
|
||||
OverwritePayload
|
||||
} from '../types/channel.ts'
|
||||
import { GuildChannels, GuildChannelPayloads } from '../types/guild.ts'
|
||||
import type { GuildChannels, GuildChannelPayloads } from '../types/guild.ts'
|
||||
import { CHANNEL, GUILD_CHANNELS } from '../types/endpoint.ts'
|
||||
import { BaseChildManager } from './baseChild.ts'
|
||||
import { ChannelsManager } from './channels.ts'
|
||||
import type { ChannelsManager } from './channels.ts'
|
||||
|
||||
export interface CreateChannelOptions {
|
||||
name: string
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Emoji } from '../structures/emoji.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import { Role } from '../structures/role.ts'
|
||||
import { EmojiPayload } from '../types/emoji.ts'
|
||||
import type { EmojiPayload } from '../types/emoji.ts'
|
||||
import { CHANNEL, GUILD_EMOJI, GUILD_EMOJIS } from '../types/endpoint.ts'
|
||||
import { BaseChildManager } from './baseChild.ts'
|
||||
import { EmojisManager } from './emojis.ts'
|
||||
import type { EmojisManager } from './emojis.ts'
|
||||
import { fetchAuto } from '../../deps.ts'
|
||||
|
||||
export class GuildEmojisManager extends BaseChildManager<EmojiPayload, Emoji> {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import { VoiceChannel } from '../structures/guildVoiceChannel.ts'
|
||||
import { User } from '../structures/user.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import type { VoiceChannel } from '../structures/guildVoiceChannel.ts'
|
||||
import type { User } from '../structures/user.ts'
|
||||
import { VoiceState } from '../structures/voiceState.ts'
|
||||
import { VoiceStatePayload } from '../types/voice.ts'
|
||||
import type { VoiceStatePayload } from '../types/voice.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
|
||||
export class GuildVoiceStatesManager extends BaseManager<
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { fetchAuto } from '../../deps.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import { Template } from '../structures/template.ts'
|
||||
import type { Template } from '../structures/template.ts'
|
||||
import { Role } from '../structures/role.ts'
|
||||
import { GUILD, GUILDS, GUILD_PREVIEW } from '../types/endpoint.ts'
|
||||
import {
|
||||
import type {
|
||||
GuildPayload,
|
||||
MemberPayload,
|
||||
GuildCreateRolePayload,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { GuildTextChannel, User } from '../../mod.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import type { GuildTextChannel, User } from '../../mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import { Invite } from '../structures/invite.ts'
|
||||
import { CHANNEL_INVITES, GUILD_INVITES, INVITE } from '../types/endpoint.ts'
|
||||
import { InvitePayload } from '../types/invite.ts'
|
||||
import type { InvitePayload } from '../types/invite.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
|
||||
export enum InviteTargetUserType {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { BaseChildManager } from './baseChild.ts'
|
||||
import { RolePayload } from '../types/role.ts'
|
||||
import type { RolePayload } from '../types/role.ts'
|
||||
import { Role } from '../structures/role.ts'
|
||||
import { Member } from '../structures/member.ts'
|
||||
import { RolesManager } from './roles.ts'
|
||||
import { MemberPayload } from '../types/guild.ts'
|
||||
import type { Member } from '../structures/member.ts'
|
||||
import type { RolesManager } from './roles.ts'
|
||||
import type { MemberPayload } from '../types/guild.ts'
|
||||
import { GUILD_MEMBER_ROLE } from '../types/endpoint.ts'
|
||||
|
||||
export class MemberRolesManager extends BaseChildManager<RolePayload, Role> {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { User } from '../structures/user.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import { Member } from '../structures/member.ts'
|
||||
import { GUILD_MEMBER } from '../types/endpoint.ts'
|
||||
import { MemberPayload } from '../types/guild.ts'
|
||||
import type { MemberPayload } from '../types/guild.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
import { Permissions } from '../utils/permissions.ts'
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Emoji } from '../structures/emoji.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import { Message } from '../structures/message.ts'
|
||||
import type { Message } from '../structures/message.ts'
|
||||
import { MessageReaction } from '../structures/messageReaction.ts'
|
||||
import { User } from '../structures/user.ts'
|
||||
import { Reaction } from '../types/channel.ts'
|
||||
import type { User } from '../structures/user.ts'
|
||||
import type { Reaction } from '../types/channel.ts'
|
||||
import {
|
||||
MESSAGE_REACTION,
|
||||
MESSAGE_REACTIONS,
|
||||
|
@ -19,7 +18,7 @@ export class MessageReactionsManager extends BaseManager<
|
|||
message: Message
|
||||
|
||||
constructor(client: Client, message: Message) {
|
||||
super(client, `reactions:${message.id}`, Guild)
|
||||
super(client, `reactions:${message.id}`, MessageReaction)
|
||||
this.message = message
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Message } from '../structures/message.ts'
|
||||
import { TextChannel } from '../structures/textChannel.ts'
|
||||
import type { TextChannel } from '../structures/textChannel.ts'
|
||||
import { User } from '../structures/user.ts'
|
||||
import { MessagePayload } from '../types/channel.ts'
|
||||
import type { MessagePayload } from '../types/channel.ts'
|
||||
import { CHANNEL_MESSAGE } from '../types/endpoint.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import { Presence } from '../structures/presence.ts'
|
||||
import { User } from '../structures/user.ts'
|
||||
import { PresenceUpdatePayload } from '../types/gateway.ts'
|
||||
import type { PresenceUpdatePayload } from '../types/gateway.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
|
||||
export class GuildPresencesManager extends BaseManager<
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { MessageReaction } from '../structures/messageReaction.ts'
|
||||
import { User } from '../structures/user.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { MessageReaction } from '../structures/messageReaction.ts'
|
||||
import type { User } from '../structures/user.ts'
|
||||
import { UsersManager } from './users.ts'
|
||||
|
||||
export class ReactionUsersManager extends UsersManager {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Permissions } from '../../mod.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import { Role } from '../structures/role.ts'
|
||||
import { GUILD_ROLE, GUILD_ROLES } from '../types/endpoint.ts'
|
||||
import { RoleModifyPayload, RolePayload } from '../types/role.ts'
|
||||
import type { RoleModifyPayload, RolePayload } from '../types/role.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
|
||||
export interface CreateGuildRoleOptions {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { User } from '../structures/user.ts'
|
||||
import { USER } from '../types/endpoint.ts'
|
||||
import { UserPayload } from '../types/user.ts'
|
||||
import type { UserPayload } from '../types/user.ts'
|
||||
import { BaseManager } from './base.ts'
|
||||
|
||||
export class UsersManager extends BaseManager<UserPayload, User> {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ApplicationPayload } from '../types/application.ts'
|
||||
import type { ApplicationPayload } from '../types/application.ts'
|
||||
import type {
|
||||
ChannelPayload,
|
||||
CreateMessagePayload,
|
||||
|
@ -9,9 +9,9 @@ import type {
|
|||
MessagePayload,
|
||||
OverwritePayload
|
||||
} from '../types/channel.ts'
|
||||
import { CreateEmojiPayload, EmojiPayload } from '../types/emoji.ts'
|
||||
import { GuildBanAddPayload } from '../types/gateway.ts'
|
||||
import { GatewayBotPayload } from '../types/gatewayBot.ts'
|
||||
import type { CreateEmojiPayload, EmojiPayload } from '../types/emoji.ts'
|
||||
import type { GuildBanAddPayload } from '../types/gateway.ts'
|
||||
import type { GatewayBotPayload } from '../types/gatewayBot.ts'
|
||||
import type {
|
||||
AuditLogPayload,
|
||||
GuildBanPayload,
|
||||
|
@ -25,18 +25,21 @@ import type {
|
|||
GuildWidgetPayload,
|
||||
MemberPayload
|
||||
} from '../types/guild.ts'
|
||||
import { InvitePayload, InviteWithMetadataPayload } from '../types/invite.ts'
|
||||
import { RoleModifyPayload, RolePayload } from '../types/role.ts'
|
||||
import type {
|
||||
InvitePayload,
|
||||
InviteWithMetadataPayload
|
||||
} from '../types/invite.ts'
|
||||
import type { RoleModifyPayload, RolePayload } from '../types/role.ts'
|
||||
import type {
|
||||
InteractionResponsePayload,
|
||||
SlashCommandPartial,
|
||||
SlashCommandPayload
|
||||
} from '../types/slash.ts'
|
||||
import { TemplatePayload } from '../types/template.ts'
|
||||
import type { TemplatePayload } from '../types/template.ts'
|
||||
import type { UserPayload } from '../types/user.ts'
|
||||
import { VoiceRegion } from '../types/voice.ts'
|
||||
import { WebhookPayload } from '../types/webhook.ts'
|
||||
import { Dict } from '../utils/dict.ts'
|
||||
import type { VoiceRegion } from '../types/voice.ts'
|
||||
import type { WebhookPayload } from '../types/webhook.ts'
|
||||
import type { Dict } from '../utils/dict.ts'
|
||||
import type { RESTManager } from './manager.ts'
|
||||
|
||||
export class RESTEndpoints {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Embed } from '../structures/embed.ts'
|
||||
import { MessageAttachment } from '../structures/message.ts'
|
||||
import { Collection } from '../utils/collection.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { simplifyAPIError } from '../utils/err_fmt.ts'
|
||||
import {
|
||||
DiscordAPIErrorPayload,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { ApplicationPayload } from '../types/application.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { ApplicationPayload } from '../types/application.ts'
|
||||
import { SnowflakeBase } from './base.ts'
|
||||
import { User } from './user.ts'
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { Snowflake } from '../utils/snowflake.ts'
|
||||
|
||||
export class Base {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ImageFormats, ImageSize } from '../types/cdn.ts'
|
||||
import type { ImageFormats, ImageSize } from '../types/cdn.ts'
|
||||
|
||||
/** Function to get Image URL from a resource on Discord CDN */
|
||||
export const ImageURL = (
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import {
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type {
|
||||
ChannelPayload,
|
||||
ChannelTypes,
|
||||
ModifyChannelOption,
|
||||
ModifyChannelPayload,
|
||||
Overwrite,
|
||||
OverwritePayload,
|
||||
OverwriteAsArg,
|
||||
OverrideType
|
||||
OverwriteAsArg
|
||||
} from '../types/channel.ts'
|
||||
import { OverrideType } from '../types/channel.ts'
|
||||
import { CHANNEL } from '../types/endpoint.ts'
|
||||
import { GuildChannelPayloads, GuildChannels } from '../types/guild.ts'
|
||||
import type { GuildChannelPayloads, GuildChannels } from '../types/guild.ts'
|
||||
import getChannelByType from '../utils/getChannelByType.ts'
|
||||
import { Permissions } from '../utils/permissions.ts'
|
||||
import { SnowflakeBase } from './base.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import { Member } from './member.ts'
|
||||
import { Role } from './role.ts'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { DMChannelPayload } from '../types/channel.ts'
|
||||
import { UserPayload } from '../types/user.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { DMChannelPayload } from '../types/channel.ts'
|
||||
import type { UserPayload } from '../types/user.ts'
|
||||
import { TextChannel } from './textChannel.ts'
|
||||
|
||||
export class DMChannel extends TextChannel {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {
|
||||
import type {
|
||||
EmbedAuthor,
|
||||
EmbedField,
|
||||
EmbedFooter,
|
||||
|
@ -10,7 +10,7 @@ import {
|
|||
EmbedVideo
|
||||
} from '../types/channel.ts'
|
||||
import { Colors, ColorUtil } from '../utils/colorutil.ts'
|
||||
import { MessageAttachment } from './message.ts'
|
||||
import type { MessageAttachment } from './message.ts'
|
||||
|
||||
/** Message Embed Object */
|
||||
export class Embed {
|
||||
|
@ -56,44 +56,72 @@ export class Embed {
|
|||
|
||||
/** Convert Embed Object to Embed Payload JSON */
|
||||
toJSON(): EmbedPayload {
|
||||
let total = 0;
|
||||
if (this.title?.length !== undefined && this.title?.length > Embed.MAX_TITLE_LENGTH) {
|
||||
let total = 0
|
||||
if (
|
||||
this.title?.length !== undefined &&
|
||||
this.title?.length > Embed.MAX_TITLE_LENGTH
|
||||
) {
|
||||
total += Number(this.title.length)
|
||||
throw new Error(`Embed title cannot exceed ${Embed.MAX_TITLE_LENGTH} characters.`)
|
||||
throw new Error(
|
||||
`Embed title cannot exceed ${Embed.MAX_TITLE_LENGTH} characters.`
|
||||
)
|
||||
}
|
||||
|
||||
if (this.description?.length !== undefined && this.description?.length > Embed.MAX_DESCRIPTION_LENGTH) {
|
||||
|
||||
if (
|
||||
this.description?.length !== undefined &&
|
||||
this.description?.length > Embed.MAX_DESCRIPTION_LENGTH
|
||||
) {
|
||||
total += Number(this.description.length)
|
||||
throw new Error(`Embed description cannot exceed ${Embed.MAX_DESCRIPTION_LENGTH} characters.`)
|
||||
throw new Error(
|
||||
`Embed description cannot exceed ${Embed.MAX_DESCRIPTION_LENGTH} characters.`
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
if (this.fields?.length !== undefined) {
|
||||
this.fields.forEach((field) => {
|
||||
if (field.name.length > Embed.MAX_FIELD_NAME_LENGTH) {
|
||||
total += Number(field.name.length)
|
||||
throw new Error(`Embed field name cannot exceed ${Embed.MAX_FIELD_NAME_LENGTH} characters.`)
|
||||
throw new Error(
|
||||
`Embed field name cannot exceed ${Embed.MAX_FIELD_NAME_LENGTH} characters.`
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
if (field.value.length > Embed.MAX_FIELD_VALUE_LENGTH) {
|
||||
total += Number(field.value.length)
|
||||
throw new Error(`Embed field value cannot exceed ${Embed.MAX_FIELD_VALUE_LENGTH} characters.`)
|
||||
throw new Error(
|
||||
`Embed field value cannot exceed ${Embed.MAX_FIELD_VALUE_LENGTH} characters.`
|
||||
)
|
||||
}
|
||||
})
|
||||
if (this.fields.length > Embed.MAX_FIELDS_LENGTH) throw new Error('Embed fields cannot exceed 25 field objects.')
|
||||
if (this.fields.length > Embed.MAX_FIELDS_LENGTH)
|
||||
throw new Error('Embed fields cannot exceed 25 field objects.')
|
||||
}
|
||||
|
||||
if (this.footer?.text?.length !== undefined && this.footer?.text?.length > Embed.MAX_FOOTER_TEXT_LENGTH) {
|
||||
|
||||
if (
|
||||
this.footer?.text?.length !== undefined &&
|
||||
this.footer?.text?.length > Embed.MAX_FOOTER_TEXT_LENGTH
|
||||
) {
|
||||
total += Number(this.footer?.text?.length)
|
||||
throw new Error(`Embed footer text cannot exceed ${Embed.MAX_FOOTER_TEXT_LENGTH}.`)
|
||||
throw new Error(
|
||||
`Embed footer text cannot exceed ${Embed.MAX_FOOTER_TEXT_LENGTH}.`
|
||||
)
|
||||
}
|
||||
|
||||
if (this.author?.name?.length !== undefined && this.author?.name?.length > Embed.MAX_AUTHOR_NAME_LENGTH) {
|
||||
|
||||
if (
|
||||
this.author?.name?.length !== undefined &&
|
||||
this.author?.name?.length > Embed.MAX_AUTHOR_NAME_LENGTH
|
||||
) {
|
||||
total += Number(this.author?.name?.length)
|
||||
throw new Error(`Embed author name cannot exceed ${Embed.MAX_AUTHOR_NAME_LENGTH}.`)
|
||||
throw new Error(
|
||||
`Embed author name cannot exceed ${Embed.MAX_AUTHOR_NAME_LENGTH}.`
|
||||
)
|
||||
}
|
||||
|
||||
if (total > Embed.MAX_EMBED_LENGTH) throw new Error(`Embed characters cannot exceed ${Embed.MAX_EMBED_LENGTH} characters in total.`)
|
||||
|
||||
|
||||
if (total > Embed.MAX_EMBED_LENGTH)
|
||||
throw new Error(
|
||||
`Embed characters cannot exceed ${Embed.MAX_EMBED_LENGTH} characters in total.`
|
||||
)
|
||||
|
||||
return {
|
||||
title: this.title,
|
||||
type: this.type,
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { ImageSize } from '../types/cdn.ts'
|
||||
import { EmojiPayload } from '../types/emoji.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { ImageSize } from '../types/cdn.ts'
|
||||
import type { EmojiPayload } from '../types/emoji.ts'
|
||||
import { CUSTOM_EMOJI, EMOJI } from '../types/endpoint.ts'
|
||||
import { Snowflake } from '../utils/snowflake.ts'
|
||||
import { Base } from './base.ts'
|
||||
import { ImageURL } from './cdn.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import { Role } from './role.ts'
|
||||
import { User } from './user.ts'
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { GroupDMChannelPayload } from '../types/channel.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { GroupDMChannelPayload } from '../types/channel.ts'
|
||||
import { Channel } from './channel.ts'
|
||||
|
||||
export class GroupDMChannel extends Channel {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import {
|
||||
GuildBanPayload,
|
||||
GuildFeatures,
|
||||
|
@ -41,12 +41,12 @@ import {
|
|||
GUILD_SPLASH
|
||||
} from '../types/endpoint.ts'
|
||||
import { GuildVoiceStatesManager } from '../managers/guildVoiceStates.ts'
|
||||
import { RequestMembersOptions } from '../gateway/mod.ts'
|
||||
import type { RequestMembersOptions } from '../gateway/mod.ts'
|
||||
import { GuildPresencesManager } from '../managers/presences.ts'
|
||||
import { TemplatePayload } from '../types/template.ts'
|
||||
import type { TemplatePayload } from '../types/template.ts'
|
||||
import { Template } from './template.ts'
|
||||
import { DiscordAPIError } from '../rest/mod.ts'
|
||||
import { ImageFormats, ImageSize } from '../types/cdn.ts'
|
||||
import type { ImageFormats, ImageSize } from '../types/cdn.ts'
|
||||
import { ImageURL } from './cdn.ts'
|
||||
|
||||
export class GuildBan extends Base {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildChannel } from './channel.ts'
|
||||
import {
|
||||
import type {
|
||||
GuildCategoryChannelPayload,
|
||||
ModifyGuildCategoryChannelOption,
|
||||
ModifyGuildCategoryChannelPayload
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import { Mixin } from '../../deps.ts'
|
||||
import { TextChannel } from './textChannel.ts'
|
||||
import { GuildChannel } from './channel.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import {
|
||||
ChannelTypes,
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type {
|
||||
GuildTextBasedChannelPayload,
|
||||
GuildTextChannelPayload,
|
||||
ModifyGuildTextBasedChannelOption,
|
||||
|
@ -11,12 +10,13 @@ import {
|
|||
ModifyGuildTextChannelOption,
|
||||
ModifyGuildTextChannelPayload
|
||||
} from '../types/channel.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import { ChannelTypes } from '../types/channel.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import { CHANNEL } from '../types/endpoint.ts'
|
||||
import { Message } from './message.ts'
|
||||
import { CreateInviteOptions } from '../managers/invites.ts'
|
||||
import { Invite } from './invite.ts'
|
||||
import { CategoryChannel } from './guildCategoryChannel.ts'
|
||||
import type { Message } from './message.ts'
|
||||
import type { CreateInviteOptions } from '../managers/invites.ts'
|
||||
import type { Invite } from './invite.ts'
|
||||
import type { CategoryChannel } from './guildCategoryChannel.ts'
|
||||
|
||||
const GUILD_TEXT_BASED_CHANNEL_TYPES: ChannelTypes[] = [
|
||||
ChannelTypes.GUILD_TEXT,
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import { VoiceServerUpdateData } from '../gateway/handlers/mod.ts'
|
||||
import { VoiceStateOptions } from '../gateway/mod.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import {
|
||||
import type { VoiceServerUpdateData } from '../gateway/handlers/mod.ts'
|
||||
import type { VoiceStateOptions } from '../gateway/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type {
|
||||
GuildVoiceChannelPayload,
|
||||
ModifyVoiceChannelOption,
|
||||
ModifyVoiceChannelPayload
|
||||
} from '../types/channel.ts'
|
||||
import { CHANNEL } from '../types/endpoint.ts'
|
||||
import { GuildChannel } from './channel.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import { VoiceState } from './voiceState.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import type { VoiceState } from './voiceState.ts'
|
||||
import { GuildChannelVoiceStatesManager } from '../managers/guildChannelVoiceStates.ts'
|
||||
import { User } from './user.ts'
|
||||
import { Member } from './member.ts'
|
||||
import type { User } from './user.ts'
|
||||
import type { Member } from './member.ts'
|
||||
|
||||
export interface VoiceServerData extends VoiceServerUpdateData {
|
||||
sessionID: string
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { ChannelPayload } from '../types/channel.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { ChannelPayload } from '../types/channel.ts'
|
||||
import { INVITE } from '../types/endpoint.ts'
|
||||
import { GuildPayload } from '../types/guild.ts'
|
||||
import { InvitePayload } from '../types/invite.ts'
|
||||
import { UserPayload } from '../types/user.ts'
|
||||
import type { GuildPayload } from '../types/guild.ts'
|
||||
import type { InvitePayload } from '../types/invite.ts'
|
||||
import type { UserPayload } from '../types/user.ts'
|
||||
import { Base } from './base.ts'
|
||||
|
||||
export class Invite extends Base {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { MemberRolesManager } from '../managers/memberRoles.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { GUILD_MEMBER } from '../types/endpoint.ts'
|
||||
import { MemberPayload } from '../types/guild.ts'
|
||||
import type { MemberPayload } from '../types/guild.ts'
|
||||
import { Permissions } from '../utils/permissions.ts'
|
||||
import { SnowflakeBase } from './base.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import { VoiceChannel } from './guildVoiceChannel.ts'
|
||||
import { Role } from './role.ts'
|
||||
import { User } from './user.ts'
|
||||
import type { Role } from './role.ts'
|
||||
import type { User } from './user.ts'
|
||||
|
||||
export interface MemberData {
|
||||
nick?: string | null
|
||||
|
|
|
@ -8,19 +8,19 @@ import {
|
|||
MessagePayload,
|
||||
MessageReference
|
||||
} from '../types/channel.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { User } from './user.ts'
|
||||
import { Member } from './member.ts'
|
||||
import type { Member } from './member.ts'
|
||||
import { Embed } from './embed.ts'
|
||||
import { CHANNEL_MESSAGE } from '../types/endpoint.ts'
|
||||
import { MessageMentions } from './messageMentions.ts'
|
||||
import { TextChannel } from './textChannel.ts'
|
||||
import { GuildTextBasedChannel } from './guildTextChannel.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import type { TextChannel } from './textChannel.ts'
|
||||
import type { GuildTextBasedChannel } from './guildTextChannel.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import { MessageReactionsManager } from '../managers/messageReactions.ts'
|
||||
import { MessageSticker } from './messageSticker.ts'
|
||||
import { Emoji } from './emoji.ts'
|
||||
import { InteractionType } from '../types/slash.ts'
|
||||
import type { Emoji } from './emoji.ts'
|
||||
import type { InteractionType } from '../types/slash.ts'
|
||||
import { encodeText } from '../utils/encoding.ts'
|
||||
|
||||
type AllMessageOptions = MessageOptions | Embed
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { MessagePayload } from '../types/channel.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { MessagePayload } from '../types/channel.ts'
|
||||
import { Collection } from '../utils/collection.ts'
|
||||
import { GuildTextBasedChannel } from './guildTextChannel.ts'
|
||||
import { Message } from './message.ts'
|
||||
import { Role } from './role.ts'
|
||||
import type { Message } from './message.ts'
|
||||
import type { Role } from './role.ts'
|
||||
import { User } from './user.ts'
|
||||
|
||||
export class MessageMentions {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { ReactionUsersManager } from '../managers/reactionUsers.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import { Reaction } from '../types/channel.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { Reaction } from '../types/channel.ts'
|
||||
import { Base } from './base.ts'
|
||||
import { Emoji } from './emoji.ts'
|
||||
import { Message } from './message.ts'
|
||||
import type { Emoji } from './emoji.ts'
|
||||
import type { Message } from './message.ts'
|
||||
|
||||
export class MessageReaction extends Base {
|
||||
message: Message
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import {
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type {
|
||||
MessageStickerFormatTypes,
|
||||
MessageStickerPayload
|
||||
} from '../types/channel.ts'
|
||||
|
|
|
@ -7,9 +7,9 @@ import {
|
|||
} from '../types/presence.ts'
|
||||
import { PresenceUpdatePayload, StatusUpdatePayload } from '../types/gateway.ts'
|
||||
import { Base } from './base.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import { User } from './user.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import type { User } from './user.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
|
||||
export enum ActivityTypes {
|
||||
PLAYING = 0,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { SnowflakeBase } from './base.ts'
|
||||
import { RoleModifyPayload, RolePayload } from '../types/role.ts'
|
||||
import type { RoleModifyPayload, RolePayload } from '../types/role.ts'
|
||||
import { Permissions } from '../utils/permissions.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import { Member } from './member.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import type { Member } from './member.ts'
|
||||
import { User } from './user.ts'
|
||||
|
||||
/** Represents a Guild Role */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import {
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type {
|
||||
AllowedMentionsPayload,
|
||||
ChannelTypes,
|
||||
EmbedPayload,
|
||||
|
@ -17,17 +17,17 @@ import {
|
|||
InteractionType,
|
||||
SlashCommandOptionType
|
||||
} from '../types/slash.ts'
|
||||
import { Dict } from '../utils/dict.ts'
|
||||
import type { Dict } from '../utils/dict.ts'
|
||||
import { Permissions } from '../utils/permissions.ts'
|
||||
import { SnowflakeBase } from './base.ts'
|
||||
import { Channel } from './channel.ts'
|
||||
import type { Channel } from './channel.ts'
|
||||
import { Embed } from './embed.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import { GuildTextChannel } from './guildTextChannel.ts'
|
||||
import { Member } from './member.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import type { GuildTextChannel } from './guildTextChannel.ts'
|
||||
import type { Member } from './member.ts'
|
||||
import { Message } from './message.ts'
|
||||
import { Role } from './role.ts'
|
||||
import { TextChannel } from './textChannel.ts'
|
||||
import type { Role } from './role.ts'
|
||||
import type { TextChannel } from './textChannel.ts'
|
||||
import { User } from './user.ts'
|
||||
|
||||
interface WebhookMessageOptions extends MessageOptions {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { TEMPLATE } from '../types/endpoint.ts'
|
||||
import { TemplatePayload } from '../types/template.ts'
|
||||
import type { TemplatePayload } from '../types/template.ts'
|
||||
import { Base } from './base.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import { User } from './user.ts'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { MessagesManager } from '../managers/messages.ts'
|
||||
import { Client } from '../client/mod.ts'
|
||||
import {
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type {
|
||||
MessageOptions,
|
||||
MessagePayload,
|
||||
TextChannelPayload
|
||||
|
@ -11,11 +11,11 @@ import {
|
|||
} from '../types/endpoint.ts'
|
||||
import { Collection } from '../utils/collection.ts'
|
||||
import { Channel } from './channel.ts'
|
||||
import { Embed } from './embed.ts'
|
||||
import type { Embed } from './embed.ts'
|
||||
import { Emoji } from './emoji.ts'
|
||||
import { Member } from './member.ts'
|
||||
import type { Member } from './member.ts'
|
||||
import { Message } from './message.ts'
|
||||
import { User } from './user.ts'
|
||||
import type { User } from './user.ts'
|
||||
|
||||
export type AllMessageOptions = MessageOptions | Embed
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import { UserPayload } from '../types/user.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import type { UserPayload } from '../types/user.ts'
|
||||
import { UserFlagsManager } from '../utils/userFlags.ts'
|
||||
import { SnowflakeBase } from './base.ts'
|
||||
import { ImageURL } from './cdn.ts'
|
||||
import { ImageSize, ImageFormats } from '../types/cdn.ts'
|
||||
import type { ImageSize, ImageFormats } from '../types/cdn.ts'
|
||||
import { DEFAULT_USER_AVATAR, USER_AVATAR } from '../types/endpoint.ts'
|
||||
import { DMChannel } from './dmChannel.ts'
|
||||
import type { DMChannel } from './dmChannel.ts'
|
||||
|
||||
export class User extends SnowflakeBase {
|
||||
id: string
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { ChannelTypes } from '../types/channel.ts'
|
||||
import { VoiceStatePayload } from '../types/voice.ts'
|
||||
import type { VoiceStatePayload } from '../types/voice.ts'
|
||||
import { Base } from './base.ts'
|
||||
import { Guild } from './guild.ts'
|
||||
import { VoiceChannel } from './guildVoiceChannel.ts'
|
||||
import { Member } from './member.ts'
|
||||
import { User } from './user.ts'
|
||||
import type { Guild } from './guild.ts'
|
||||
import type { VoiceChannel } from './guildVoiceChannel.ts'
|
||||
import type { Member } from './member.ts'
|
||||
import type { User } from './user.ts'
|
||||
|
||||
export class VoiceState extends Base {
|
||||
guild?: Guild
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Client } from '../client/mod.ts'
|
||||
import type { Client } from '../client/mod.ts'
|
||||
import { RESTManager } from '../rest/mod.ts'
|
||||
import { MessageOptions } from '../types/channel.ts'
|
||||
import { UserPayload } from '../types/user.ts'
|
||||
import { WebhookPayload } from '../types/webhook.ts'
|
||||
import type { MessageOptions } from '../types/channel.ts'
|
||||
import type { UserPayload } from '../types/user.ts'
|
||||
import type { WebhookPayload } from '../types/webhook.ts'
|
||||
import { Embed } from './embed.ts'
|
||||
import { Message } from './message.ts'
|
||||
import { TextChannel } from './textChannel.ts'
|
||||
import type { TextChannel } from './textChannel.ts'
|
||||
import { User } from './user.ts'
|
||||
import { fetchAuto } from '../../deps.ts'
|
||||
import { WEBHOOK_MESSAGE } from '../types/endpoint.ts'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { UserPayload } from './user.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
|
||||
export interface ApplicationPayload {
|
||||
id: string
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Embed } from '../structures/embed.ts'
|
||||
import { Member } from '../structures/member.ts'
|
||||
import { Message, MessageAttachment } from '../structures/message.ts'
|
||||
import { Role } from '../structures/role.ts'
|
||||
import { Permissions } from '../utils/permissions.ts'
|
||||
import { EmojiPayload } from './emoji.ts'
|
||||
import { MemberPayload } from './guild.ts'
|
||||
import { InteractionType } from './slash.ts'
|
||||
import { UserPayload } from './user.ts'
|
||||
import type { Embed } from '../structures/embed.ts'
|
||||
import type { Member } from '../structures/member.ts'
|
||||
import type { Message, MessageAttachment } from '../structures/message.ts'
|
||||
import type { Role } from '../structures/role.ts'
|
||||
import type { Permissions } from '../utils/permissions.ts'
|
||||
import type { EmojiPayload } from './emoji.ts'
|
||||
import type { MemberPayload } from './guild.ts'
|
||||
import type { InteractionType } from './slash.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
|
||||
export interface ChannelPayload {
|
||||
id: string
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { UserPayload } from './user.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
|
||||
export interface EmojiPayload {
|
||||
id: string | null
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
// https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway
|
||||
// https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import { Member } from '../structures/member.ts'
|
||||
import { EmojiPayload } from './emoji.ts'
|
||||
import { MemberPayload } from './guild.ts'
|
||||
import {
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import type { Member } from '../structures/member.ts'
|
||||
import type { EmojiPayload } from './emoji.ts'
|
||||
import type { MemberPayload } from './guild.ts'
|
||||
import type {
|
||||
ActivityGame,
|
||||
ActivityPayload,
|
||||
StatusType,
|
||||
ClientStatus
|
||||
} from './presence.ts'
|
||||
import { RolePayload } from './role.ts'
|
||||
import { SlashCommandPayload } from './slash.ts'
|
||||
import { UserPayload } from './user.ts'
|
||||
import type { RolePayload } from './role.ts'
|
||||
import type { SlashCommandPayload } from './slash.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
|
||||
/**
|
||||
* Gateway OPcodes from Discord docs.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { GatewayOpcodes, GatewayEvents } from './gateway.ts'
|
||||
import type { GatewayOpcodes, GatewayEvents } from './gateway.ts'
|
||||
|
||||
/**
|
||||
* Gateway response from Discord.
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { GuildChannel } from '../structures/channel.ts'
|
||||
import { Emoji } from '../structures/emoji.ts'
|
||||
import { CategoryChannel } from '../structures/guildCategoryChannel.ts'
|
||||
import { NewsChannel } from '../structures/guildNewsChannel.ts'
|
||||
import { VoiceChannel } from '../structures/guildVoiceChannel.ts'
|
||||
import { Role } from '../structures/role.ts'
|
||||
import {
|
||||
import type { GuildChannel } from '../structures/channel.ts'
|
||||
import type { Emoji } from '../structures/emoji.ts'
|
||||
import type { CategoryChannel } from '../structures/guildCategoryChannel.ts'
|
||||
import type { NewsChannel } from '../structures/guildNewsChannel.ts'
|
||||
import type { VoiceChannel } from '../structures/guildVoiceChannel.ts'
|
||||
import type { Role } from '../structures/role.ts'
|
||||
import type {
|
||||
GuildTextChannel,
|
||||
GuildTextBasedChannel
|
||||
} from '../structures/guildTextChannel.ts'
|
||||
import { ApplicationPayload } from './application.ts'
|
||||
import {
|
||||
import type { ApplicationPayload } from './application.ts'
|
||||
import type {
|
||||
ChannelPayload,
|
||||
ChannelTypes,
|
||||
GuildCategoryChannelPayload,
|
||||
|
@ -18,12 +18,12 @@ import {
|
|||
GuildTextChannelPayload,
|
||||
GuildVoiceChannelPayload
|
||||
} from './channel.ts'
|
||||
import { EmojiPayload } from './emoji.ts'
|
||||
import { PresenceUpdatePayload } from './gateway.ts'
|
||||
import { RolePayload } from './role.ts'
|
||||
import { UserPayload } from './user.ts'
|
||||
import { VoiceStatePayload } from './voice.ts'
|
||||
import { WebhookPayload } from './webhook.ts'
|
||||
import type { EmojiPayload } from './emoji.ts'
|
||||
import type { PresenceUpdatePayload } from './gateway.ts'
|
||||
import type { RolePayload } from './role.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
import type { VoiceStatePayload } from './voice.ts'
|
||||
import type { WebhookPayload } from './webhook.ts'
|
||||
|
||||
export interface GuildPayload {
|
||||
id: string
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Channel } from '../structures/channel.ts'
|
||||
import { Guild } from '../structures/guild.ts'
|
||||
import { ChannelPayload } from './channel.ts'
|
||||
import { GuildPayload } from './guild.ts'
|
||||
import { UserPayload } from './user.ts'
|
||||
import type { Channel } from '../structures/channel.ts'
|
||||
import type { Guild } from '../structures/guild.ts'
|
||||
import type { ChannelPayload } from './channel.ts'
|
||||
import type { GuildPayload } from './guild.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
|
||||
export interface InvitePayload {
|
||||
code: string
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Dict } from '../utils/dict.ts'
|
||||
import {
|
||||
import type { Dict } from '../utils/dict.ts'
|
||||
import type {
|
||||
AllowedMentionsPayload,
|
||||
ChannelTypes,
|
||||
EmbedPayload
|
||||
} from './channel.ts'
|
||||
import { MemberPayload } from './guild.ts'
|
||||
import { RolePayload } from './role.ts'
|
||||
import { UserPayload } from './user.ts'
|
||||
import type { MemberPayload } from './guild.ts'
|
||||
import type { RolePayload } from './role.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
|
||||
export interface InteractionApplicationCommandOption {
|
||||
/** Option name */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildPayload } from './guild.ts'
|
||||
import { UserPayload } from './user.ts'
|
||||
import type { GuildPayload } from './guild.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
|
||||
export interface TemplatePayload {
|
||||
code: string
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { MemberPayload } from './guild.ts'
|
||||
import type { MemberPayload } from './guild.ts'
|
||||
|
||||
export enum VoiceOpcodes {
|
||||
IDENTIFY = 0,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { UserPayload } from './user.ts'
|
||||
import type { UserPayload } from './user.ts'
|
||||
|
||||
export interface WebhookPayload {
|
||||
id: string
|
||||
|
|
Loading…
Reference in a new issue