channel

Useful helper functions for interacting with various discord channel objects.

async get_or_fetch_channel(bot, channel_id)[source]

Attempt to get or fetch the given channel_id from the bots cache, and return it.

Parameters:
Raises:
Return type:

GuildChannel | PrivateChannel | Thread

Returns:

The channel from the ID.

is_in_category(channel, category_id)[source]

Return whether the given channel in the the category with the id category_id.

Parameters:
  • channel (TextChannel) – The channel to check.

  • category_id (int) – The category to check for.

Return type:

bool

Returns:

A bool depending on whether the channel is in the category.