Skip to content

Fetching Channels

nutmeg edited this page Feb 22, 2023 · 5 revisions

Run Down

Fetching channels is taking an id or a mention (#channel or <#id>) and returning the channel's info
If the channel does not exist it returns null

Fetching Cache Channels

Cache channel fetching is called with PSClient.fetchChannel() and it uses the bot's channel cache to return the channel's info

let channel = PSClient.fetchChannel(channel);

Fetching Guild Channels

Guild channel fetching is called with PSClient.fetchGuildChannel() and it uses the guild to return the channel's info
It also has an optional guild value if you wish to use it and it defaults to ctx.guild

let channel = await PSClient.fetchGuildChannel(channel);

// or for guild

let channel = await PSClient.fetchGuildChannel(channel, guild);

Fetch Channel Related Functions

PSClient.fetchChannel

  • Description: Fetches the info for a channel using the bot's cache
  • Setup: PSClient.fetchChannel(channel)
  • Returns: Channel

PSClient.fetchGuildChannel

  • Description: Fetches the info for a channel using the guild
  • Setup: await PSClient.fetchGuildChannel(channel, ?guild)
  • Returns: Guild Channel

Clone this wiki locally