Appearance
GuildChannel
Package: @erinjs/core
Constructor
| Name | Type | Optional | Description |
|---|---|---|---|
client | Client | No | |
data | APIChannel | No |
Properties
| Name | Type | Readonly | Optional | Description |
|---|---|---|---|---|
guildId | string | Yes | No | |
name | string | null | No | No | |
parentId | string | null | No | No | |
permissionOverwrites | APIChannelOverwrite[] | No | No | Permission overwrites for roles and members. |
position | number | No | Yes |
Methods
canSendMessage()
Whether the bot can send messages in this channel. Checks ViewChannel and SendMessages via guild.members.me permissions. Returns false if guild or bot member not cached.
Returns: boolean
Parameters:
None
createInvite() async
Create an invite for this channel.
Returns: Promise<Invite>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { max_uses?: number; max_age?: number; unique?: boolean; temporary?: boolean; } | Yes | max_uses (0–100), max_age (0–604800 seconds), unique, temporary |
| Requires Create Instant Invite permission. |
createWebhook() async
Create a webhook in this channel.
Returns: Promise<Webhook>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { name: string; avatar?: string | null; } | No | Webhook name and optional avatar URL |
delete() async
Delete this channel. Requires Manage Channel permission.
Returns: Promise<void>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { silent?: boolean; } | Yes | silent: if true, does not send a system message (default false) |
deletePermission() async
Remove a permission overwrite. DELETE /channels/{id}/permissions/{overwriteId}.
Returns: Promise<void>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
overwriteId | string | No |
edit() async
Edit this channel. PATCH /channels/{id}. Requires Manage Channel permission.
Returns: Promise<this>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { name?: string | null; topic?: string | null; parent_id?: string | null; bitrate?: number | null; user_limit?: number | null; nsfw?: boolean; rate_limit_per_user?: number; rtc_region?: string | null; permission_overwrites?: Array<{ id: string; type: number; allow?: string; deny?: string; }>; } | No |
editPermission() async
Set or update a permission overwrite. PUT /channels/{id}/permissions/{overwriteId}.
Returns: Promise<void>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
overwriteId | string | No | Role or member ID |
options | { type: 0 | 1; allow?: string; deny?: string; } | No | type (0=role, 1=member), allow, deny (permission bitfields) |
fetchInvites() async
Fetch invites for this channel. Requires Manage Channel permission.
Returns: Promise<Invite[]>
Parameters:
None
fetchWebhooks() async
Fetch all webhooks in this channel.
Returns: Promise<Webhook[]>
Parameters:
None
send() async
Send a message to this guild channel. Works for text and announcement channels. Voice/category/link channels will fail at the API.
Returns: Promise<Message>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | MessageSendOptions | No |