message: load all channels into cache
diff: @@ -15,8 +15,10 @@ import { calculate_permissions, bot_has_permission } from "../utils/permissions.
  import { Permissions } from "../types/permission.ts"
  import { Errors } from "../types/errors.ts"
  import { Request_Manager } from "../module/request_manager.ts"
  +import { cache } from "../utils/cache.ts"
  -export const create_channel = (data: Channel_Create_Payload, client: Client) => ({
  +export const create_channel = (data: Channel_Create_Payload, client: Client) => {
  + const channel = {
  /** The raw channel data */
  raw: () => data,
  /** The unique id of the channel */
  @@ -62,7 +64,10 @@ export const create_channel = (data: Channel_Create_Payload, client: Client) =>
  if (options?.limit && options.limit > 100) return
  - const result = (await Request_Manager.get(endpoints.CHANNEL_MESSAGES(data.id), options)) as Message_Create_Options[]
  + const result = (await Request_Manager.get(
  + endpoints.CHANNEL_MESSAGES(data.id),
  + options
  + )) as Message_Create_Options[]
  return result.map(res => create_message(res, client))
  },
  /** Get pinned messages in this channel. */
  @@ -72,7 +77,7 @@ export const create_channel = (data: Channel_Create_Payload, client: Client) =>
  },
  /** Send a message to the channel. Requires SEND_MESSAGES permission. */
  send_message: async (content: string | MessageContent) => {
  - console.log('SENDING_MESSAGE:', content)
  + console.log("SENDING_MESSAGE:", content)
  if (typeof content === "string") content = { content }
  if (data.guild_id) {
  @@ -106,7 +111,9 @@ export const create_channel = (data: Channel_Create_Payload, client: Client) =>
  if (ids.length < 2) throw new Error(Errors.DELETE_MESSAGES_MIN)
  if (ids.length > 100)
  - console.warn(`This endpoint only accepts a maximum of 100 messages. Deleting the first 100 message ids provided.`)
  + console.warn(
  + `This endpoint only accepts a maximum of 100 messages. Deleting the first 100 message ids provided.`
  + )
  return Request_Manager.post(endpoints.CHANNEL_BULK_DELETE(data.id), {
  messages: ids.splice(0, 100),
  @@ -136,4 +143,8 @@ export const create_channel = (data: Channel_Create_Payload, client: Client) =>
  // join: () => {},
  /** Leave a voice channel */
  // leave: () => {}
  -})
  + }
  +
  + cache.channels.set(data.id, channel)
  + return channel
  +}
  