Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a80a68b
commit 5e5b407
Showing
112 changed files
with
4,478 additions
and
4,282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.lint": false, | ||
"deno.unstable": false, | ||
"deepscan.enable": true, | ||
"deno.import_intellisense_origins": { | ||
"https://deno.land": true | ||
}, | ||
"editor.tabSize": 2, | ||
"editor.formatOnSave": true | ||
} | ||
{ | ||
"deno.enable": true, | ||
"deno.lint": false, | ||
"deno.unstable": false, | ||
"deepscan.enable": true, | ||
"deno.import_intellisense_origins": { | ||
"https://deno.land": true | ||
}, | ||
"editor.tabSize": 2, | ||
"editor.formatOnSave": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,70 @@ | ||
export * from './src/gateway/index.ts' | ||
export * from './src/models/client.ts' | ||
export * from './src/models/rest.ts' | ||
export * from './src/models/cacheAdapter.ts' | ||
export * from './src/models/shard.ts' | ||
export * from './src/models/command.ts' | ||
export * from './src/models/extensions.ts' | ||
export * from './src/models/commandClient.ts' | ||
export * from './src/managers/base.ts' | ||
export * from './src/managers/baseChild.ts' | ||
export * from './src/managers/channels.ts' | ||
export * from './src/managers/emojis.ts' | ||
export * from './src/managers/gatewayCache.ts' | ||
export * from './src/managers/guildChannels.ts' | ||
export * from './src/managers/guilds.ts' | ||
export * from './src/managers/guildChannels.ts' | ||
export * from './src/managers/guildEmojis.ts' | ||
export * from './src/managers/members.ts' | ||
export * from './src/managers/messageReactions.ts' | ||
export * from './src/managers/reactionUsers.ts' | ||
export * from './src/managers/messages.ts' | ||
export * from './src/managers/roles.ts' | ||
export * from './src/managers/users.ts' | ||
export * from './src/structures/application.ts' | ||
export * from './src/structures/base.ts' | ||
export * from './src/structures/cdn.ts' | ||
export * from './src/structures/channel.ts' | ||
export * from './src/structures/dmChannel.ts' | ||
export * from './src/structures/embed.ts' | ||
export * from './src/structures/emoji.ts' | ||
export * from './src/structures/groupChannel.ts' | ||
export * from './src/structures/guild.ts' | ||
export * from './src/structures/guildCategoryChannel.ts' | ||
export * from './src/structures/guildNewsChannel.ts' | ||
export * from './src/structures/guildVoiceChannel.ts' | ||
export * from './src/structures/invite.ts' | ||
export * from './src/structures/member.ts' | ||
export * from './src/structures/message.ts' | ||
export * from './src/structures/messageMentions.ts' | ||
export * from './src/structures/presence.ts' | ||
export * from './src/structures/role.ts' | ||
export * from './src/structures/snowflake.ts' | ||
export * from './src/structures/textChannel.ts' | ||
export * from './src/structures/messageReaction.ts' | ||
export * from './src/structures/user.ts' | ||
export * from './src/structures/webhook.ts' | ||
export * from './src/types/application.ts' | ||
export * from './src/types/cdn.ts' | ||
export * from './src/types/channel.ts' | ||
export * from './src/types/emoji.ts' | ||
export * from './src/types/endpoint.ts' | ||
export * from './src/types/gateway.ts' | ||
export * from './src/types/gatewayBot.ts' | ||
export * from './src/types/gatewayResponse.ts' | ||
export * from './src/types/guild.ts' | ||
export * from './src/types/invite.ts' | ||
export * from './src/types/permissionFlags.ts' | ||
export * from './src/types/presence.ts' | ||
export * from './src/types/role.ts' | ||
export * from './src/types/template.ts' | ||
export * from './src/types/user.ts' | ||
export * from './src/types/voice.ts' | ||
export * from './src/types/webhook.ts' | ||
export * from './src/utils/collection.ts' | ||
export * from './src/utils/intents.ts' | ||
export * from './src/utils/buildInfo.ts' | ||
export * from './src/utils/permissions.ts' | ||
export * from './src/utils/userFlags.ts' | ||
export * from './src/utils/bitfield.ts' | ||
export * from './src/utils/getChannelByType.ts' | ||
export * from './src/gateway/index.ts' | ||
export * from './src/models/client.ts' | ||
export * from './src/models/rest.ts' | ||
export * from './src/models/cacheAdapter.ts' | ||
export * from './src/models/shard.ts' | ||
export * from './src/models/command.ts' | ||
export * from './src/models/extensions.ts' | ||
export * from './src/models/commandClient.ts' | ||
export * from './src/managers/base.ts' | ||
export * from './src/managers/baseChild.ts' | ||
export * from './src/managers/channels.ts' | ||
export * from './src/managers/emojis.ts' | ||
export * from './src/managers/gatewayCache.ts' | ||
export * from './src/managers/guildChannels.ts' | ||
export * from './src/managers/guilds.ts' | ||
export * from './src/managers/guildChannels.ts' | ||
export * from './src/managers/guildEmojis.ts' | ||
export * from './src/managers/members.ts' | ||
export * from './src/managers/messageReactions.ts' | ||
export * from './src/managers/reactionUsers.ts' | ||
export * from './src/managers/messages.ts' | ||
export * from './src/managers/roles.ts' | ||
export * from './src/managers/users.ts' | ||
export * from './src/structures/application.ts' | ||
export * from './src/structures/base.ts' | ||
export * from './src/structures/cdn.ts' | ||
export * from './src/structures/channel.ts' | ||
export * from './src/structures/dmChannel.ts' | ||
export * from './src/structures/embed.ts' | ||
export * from './src/structures/emoji.ts' | ||
export * from './src/structures/groupChannel.ts' | ||
export * from './src/structures/guild.ts' | ||
export * from './src/structures/guildCategoryChannel.ts' | ||
export * from './src/structures/guildNewsChannel.ts' | ||
export * from './src/structures/guildVoiceChannel.ts' | ||
export * from './src/structures/invite.ts' | ||
export * from './src/structures/member.ts' | ||
export * from './src/structures/message.ts' | ||
export * from './src/structures/messageMentions.ts' | ||
export * from './src/structures/presence.ts' | ||
export * from './src/structures/role.ts' | ||
export * from './src/structures/snowflake.ts' | ||
export * from './src/structures/textChannel.ts' | ||
export * from './src/structures/messageReaction.ts' | ||
export * from './src/structures/user.ts' | ||
export * from './src/structures/webhook.ts' | ||
export * from './src/types/application.ts' | ||
export * from './src/types/cdn.ts' | ||
export * from './src/types/channel.ts' | ||
export * from './src/types/emoji.ts' | ||
export * from './src/types/endpoint.ts' | ||
export * from './src/types/gateway.ts' | ||
export * from './src/types/gatewayBot.ts' | ||
export * from './src/types/gatewayResponse.ts' | ||
export * from './src/types/guild.ts' | ||
export * from './src/types/invite.ts' | ||
export * from './src/types/permissionFlags.ts' | ||
export * from './src/types/presence.ts' | ||
export * from './src/types/role.ts' | ||
export * from './src/types/template.ts' | ||
export * from './src/types/user.ts' | ||
export * from './src/types/voice.ts' | ||
export * from './src/types/webhook.ts' | ||
export * from './src/utils/collection.ts' | ||
export * from './src/utils/intents.ts' | ||
export * from './src/utils/buildInfo.ts' | ||
export * from './src/utils/permissions.ts' | ||
export * from './src/utils/userFlags.ts' | ||
export * from './src/utils/bitfield.ts' | ||
export * from './src/utils/getChannelByType.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export const DISCORD_API_URL: string = 'https://discord.com/api' | ||
|
||
export const DISCORD_GATEWAY_URL: string = 'wss://gateway.discord.gg' | ||
|
||
export const DISCORD_CDN_URL: string = 'https://cdn.discordapp.com' | ||
|
||
export const DISCORD_API_VERSION: number = 8 | ||
|
||
export const DISCORD_VOICE_VERSION: number = 4 | ||
export const DISCORD_API_URL: string = 'https://discord.com/api' | ||
|
||
export const DISCORD_GATEWAY_URL: string = 'wss://gateway.discord.gg' | ||
|
||
export const DISCORD_CDN_URL: string = 'https://cdn.discordapp.com' | ||
|
||
export const DISCORD_API_VERSION: number = 8 | ||
|
||
export const DISCORD_VOICE_VERSION: number = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { Gateway, GatewayEventHandler } from '../index.ts' | ||
import { ChannelPayload } from '../../types/channel.ts' | ||
|
||
export const channelDelete: GatewayEventHandler = async ( | ||
gateway: Gateway, | ||
d: ChannelPayload | ||
) => { | ||
const channel = await gateway.client.channels.get(d.id) | ||
if (channel !== undefined) { | ||
await gateway.client.channels.delete(d.id) | ||
gateway.client.emit('channelDelete', channel) | ||
} | ||
} | ||
import { Gateway, GatewayEventHandler } from '../index.ts' | ||
import { ChannelPayload } from '../../types/channel.ts' | ||
|
||
export const channelDelete: GatewayEventHandler = async ( | ||
gateway: Gateway, | ||
d: ChannelPayload | ||
) => { | ||
const channel = await gateway.client.channels.get(d.id) | ||
if (channel !== undefined) { | ||
await gateway.client.channels.delete(d.id) | ||
gateway.client.emit('channelDelete', channel) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import { Gateway, GatewayEventHandler } from '../index.ts' | ||
import { TextChannel } from '../../structures/textChannel.ts' | ||
import { ChannelPinsUpdatePayload } from '../../types/gateway.ts' | ||
|
||
export const channelPinsUpdate: GatewayEventHandler = async ( | ||
gateway: Gateway, | ||
d: ChannelPinsUpdatePayload | ||
) => { | ||
const after: | ||
| TextChannel | ||
| undefined = await gateway.client.channels.get<TextChannel>(d.channel_id) | ||
if (after !== undefined) { | ||
const before = after.refreshFromData({ | ||
last_pin_timestamp: d.last_pin_timestamp, | ||
}) | ||
const raw = await gateway.client.channels._get(d.channel_id) | ||
await gateway.client.channels.set( | ||
after.id, | ||
Object.assign(raw, { last_pin_timestamp: d.last_pin_timestamp }) | ||
) | ||
gateway.client.emit('channelPinsUpdate', before, after) | ||
} | ||
} | ||
import { Gateway, GatewayEventHandler } from '../index.ts' | ||
import { TextChannel } from '../../structures/textChannel.ts' | ||
import { ChannelPinsUpdatePayload } from '../../types/gateway.ts' | ||
|
||
export const channelPinsUpdate: GatewayEventHandler = async ( | ||
gateway: Gateway, | ||
d: ChannelPinsUpdatePayload | ||
) => { | ||
const after: | ||
| TextChannel | ||
| undefined = await gateway.client.channels.get<TextChannel>(d.channel_id) | ||
if (after !== undefined) { | ||
const before = after.refreshFromData({ | ||
last_pin_timestamp: d.last_pin_timestamp | ||
}) | ||
const raw = await gateway.client.channels._get(d.channel_id) | ||
await gateway.client.channels.set( | ||
after.id, | ||
Object.assign(raw, { last_pin_timestamp: d.last_pin_timestamp }) | ||
) | ||
gateway.client.emit('channelPinsUpdate', before, after) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { Channel } from '../../structures/channel.ts' | ||
import { ChannelPayload } from '../../types/channel.ts' | ||
import { Gateway, GatewayEventHandler } from '../index.ts' | ||
|
||
export const channelUpdate: GatewayEventHandler = async ( | ||
gateway: Gateway, | ||
d: ChannelPayload | ||
) => { | ||
const oldChannel = await gateway.client.channels.get(d.id) | ||
await gateway.client.channels.set(d.id, d) | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | ||
const newChannel = (await gateway.client.channels.get(d.id)) as Channel | ||
|
||
if (oldChannel !== undefined) { | ||
// (DjDeveloperr): Already done by ChannelsManager. I'll recheck later | ||
// if ('guild_id' in d) { | ||
// // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | ||
// (newChannel as GuildChannel).guild = await gateway.client.guilds.get((d as GuildChannelPayload).guild_id) as Guild | ||
// } | ||
gateway.client.emit('channelUpdate', oldChannel, newChannel) | ||
} else gateway.client.emit('channelUpdateUncached', newChannel) | ||
} | ||
import { Channel } from '../../structures/channel.ts' | ||
import { ChannelPayload } from '../../types/channel.ts' | ||
import { Gateway, GatewayEventHandler } from '../index.ts' | ||
|
||
export const channelUpdate: GatewayEventHandler = async ( | ||
gateway: Gateway, | ||
d: ChannelPayload | ||
) => { | ||
const oldChannel = await gateway.client.channels.get(d.id) | ||
await gateway.client.channels.set(d.id, d) | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | ||
const newChannel = (await gateway.client.channels.get(d.id)) as Channel | ||
|
||
if (oldChannel !== undefined) { | ||
// (DjDeveloperr): Already done by ChannelsManager. I'll recheck later | ||
// if ('guild_id' in d) { | ||
// // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | ||
// (newChannel as GuildChannel).guild = await gateway.client.guilds.get((d as GuildChannelPayload).guild_id) as Guild | ||
// } | ||
gateway.client.emit('channelUpdate', oldChannel, newChannel) | ||
} else gateway.client.emit('channelUpdateUncached', newChannel) | ||
} |
Oops, something went wrong.