Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GuildChannelManager

Manages API methods for guild Channels

Hierarchy

Index

Constructors

Properties

client: Client

The Client that instantiated this Manager

guild: Guild

The Guild that instantiated this Manager

Accessors

  • A manager of the channels belonging to this guild

    Returns LimitedCollection<string, Channel>

Methods

  • Creates a Channel

    example
    guild.channels.create({ name: 'general', type: GuildChannelType.GuildText }, 'Use this chat to talk with other members');
    
    example
    guild.channels.create({ name: 'news', type: GuildChannelType.GuildNews }, 'Use this chat to notify other members');
    

    Parameters

    • options: Partial<Channel>

      The options to create the channel

    • reason: string = ''

      The reason to create the channel

    Returns Promise<Channel>

  • delete(id: string, reason?: string): Promise<Channel>
  • Deletes a Channel

    example
    guild.channels.delete(channel.id, 'I am no longer needed');
    

    Parameters

    • id: string

      The Id of the channel

    • reason: string = ''

      The reason to delete the channel

    Returns Promise<Channel>

  • edit(id: string, options: Partial<Channel>, reason?: string): Promise<Channel>
  • Edits a Channel

    example
    guild.channels.edit(channel.id, { name: 'new-name', nsfw: true });
    

    Parameters

    • id: string

      The Id of the channel

    • options: Partial<Channel>

      The options to edit the channel with

    • reason: string = ''

      The reason to edit the channel

    Returns Promise<Channel>

  • Sends a message to this channel

    example
    const { EmbedBuilder } = require('helly');
    const embed = new EmbedBuilder().setTitle('Pong!')
    guild.channels.send('12345678901234567', { embeds: [embed] })
    example
    const { EmbedBuilder } = require('helly');
    const embed = new EmbedBuilder().setTitle('Pong!')
    guild.channels.send'12345678901234567', ({ content: 'Ping?', embeds: [embed] })
    example
    guild.channels.send('12345678901234567', 'Hello world!')
    

    Parameters

    • channelId: string

      The Id of the target channel

    • content: MessageOptions

      The content of the message

    Returns Promise<Message>

Generated using TypeDoc version 0.22.16, the 9/16/2022 at 1:09:15 AM