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