events.channel_create: Event, emitted whenever a channel is being created

Description Usage Arguments Disclaimer Examples

View source: R/events_channelcreate.r

Description

Event, emitted whenever a channel is being created

Usage

1

Arguments

data

The event fields

client

The client object

Disclaimer

Since Pirate does NOT handle channel types for you you will have to be aware of it when involving complex actions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
client$emitter$on("CHANNEL_CREATE", function(channel) {
 guild_channel_types = c(0, 2, 4, 5, 6)
 if (channel$type %in% guild_channel_types) {
   guild <- client$guilds$get(channel$guild_id)
   cat("A new channel called:", channel$name, "has been created in:", guild$id)
 }
})

## End(Not run)

TheOnlyArtz/Pirate documentation built on Oct. 31, 2019, 12:12 a.m.