Skip to content

$newChannel

$newChannel holds data of the updated channel, used in channel update, delete and create events, or else any data will be empty.

Usage

$newChannel[option]

Parameters

FieldTypeDescriptionRequired
optionstringOption to retrieve.true

Options

FieldTypeDescription
namestringReturns channel name.
idnumberReturns channel ID.
createdAtnumberReturns date of when was channel created.
createdTimestampnumberReturns the timestamp of when was channel created.
defaultAutoArchiveDurationnumberReturns Default Archive Duration.
deleteablestringReturns true / false if channel is deleteable.
deletedstringReturns true / false if channel was deleted.
guildIDnumberReturns guild ID of current guild.
lastMessageContentstringReturns content of last message sent in channel.
lastMessageIDnumberReturns ID of last message sent in channel.
lastPinAtnumberReturns date of last pinned message.
lastPinTimestampnumberReturns the timestamp of last pinned message.
manageablestringReturns true / false if channel is manageable.
nsfwstringReturns true / false if channel is NSFW.
parentNamestringReturns Category Name.
parentIDnumberReturns Category ID.
positionnumberReturns channel position.
slowmodenumberReturns channel slowmode. (if there are any)
topicstringReturns channel topic.
typestringReturns channel type.
viewablestringReturns true / false if channel is viewable.
permsAllowedstringReturns allowed permissions for current channel.
permsDeniedstringReturns denied permissions for current channel.
permsstringReturns permissions for current channel.
joinablestringReturns true / false if channel is joinable (only if its voice channel).
userLimitnumberReturns user limit for current (voice) channel.
messageCountnumberReturns message count of messages sent in current channel.

Example(s)

1
client.channelCreateCommand({
2
channel: "channelid",
3
code: `
4
New channel has been created!
5
- Name: $newChannel[name]
6
- ID: $newChannel[id]
7
- <#$newChannel[id]>`
8
});
  • This code will execute when channel is created.

1
client.channelDeleteCommand({
2
channel: "channelid",
3
code: `
4
Channel has been deleted!
5
- Name: $oldChannel[name]
6
- ID: $oldChannel[id]`
7
});
  • This code will execute when channel is deleted.

1
client.channelUpdateCommand({
2
channel: "channelid",
3
code: `
4
Channel has been updated!
5
- New name: $newChannel[name]
6
- Old name: $oldChannel[name]`
7
});
  • This code will execute when channel is updated.