ChannelDeleteCommand
Triggers when a channel is deleted from a guild. Placeholders can be used to retrieve data from the deleted channel.

Placeholders: 11

  1. 1.
    {id} - channel id
  2. 2.
    {name} - channel name
  3. 3.
    {type} - channel type
  4. 4.
    {parentposition} - position in category when deleted
  5. 5.
    {rawposition} - position in channel list when deleted
  6. 6.
    {parentid} - category id of the channel
  7. 7.
    {parentname} - category name of the channel when deleted
  8. 8.
    {guildid} - guild id of where the channel is deleted
  9. 9.
    {guildname} guild name of where the channel is deleted
  10. 10.
    {created} - date of the creation of the channel
  11. 11.
    {timestamp} - how long ago the channel was created

Example 1: The event placed in the main file.

1
bot.ChannelDeleteCommand({
2
name: "$getServerVar[channel]",
3
code: `
4
{name} channel in {guildname} was just deleted!
5
`
6
})
7
bot.onChannelDelete()
Copied!

Example 2: The event placed in the event handler (its own file)

bot.onChannelDelete() - Goes in the main file to be able to call the event!
1
module.exports.ChannelDeleteCommand = ({
2
name: "$getServerVar[channel]",
3
code: `
4
{name} channel in {guildname} was just deleted!
5
`
6
})
Copied!
Last modified 5mo ago
Copy link