func (c *Client) OnGuildInviteCreate(f func(i *GuildInviteCreate)) {
	c.registerHandler(eventGuildInviteCreate, guildInviteCreateHandler(f))
}
OnGuildInviteCreate registers the handler function for the "GUILD_ROLE_DELETE" event.
Fired when a guild role is deleted.
package harmony
import (
	"github.com/skwair/harmony/discord"
	"github.com/skwair/harmony/voice"
)
type handler interface {
	handle(interface{})
}
var intents = map[string]discord.GatewayIntent{
	eventGuildCreate:       discord.GatewayIntentGuild,
	eventGuildUpdate:       discord.GatewayIntentGuild,
	eventGuildRoleCreate:   discord.GatewayIntentGuild,
	eventGuildRoleUpdate:   discord.GatewayIntentGuild,
	eventGuildRoleDelete:   discord.GatewayIntentGuild,
	eventChannelCreate:     discord.GatewayIntentGuild,
	eventChannelUpdate:     discord.GatewayIntentGuild,
	eventChannelDelete:     discord.GatewayIntentGuild,
	eventChannelPinsUpdate: discord.GatewayIntentGuild,
	eventGuildMemberAdd:    discord.GatewayIntentGuildMembers,
	eventGuildMemberUpdate: discord.GatewayIntentGuildMembers,
	eventGuildMemberRemove: discord.GatewayIntentGuildMembers,
	eventGuildBanAdd:    discord.GatewayIntentGuildBans,
	eventGuildBanRemove: discord.GatewayIntentGuildBans,
	eventGuildEmojisUpdate: discord.GatewayIntentGuildEmojis,
	eventGuildIntegrationsUpdate: discord.GatewayIntentGuildIntegrations,
	eventWebhooksUpdate: discord.GatewayIntentGuildWebhooks,
	eventGuildInviteCreate: discord.GatewayIntentGuildInvites,
	eventGuildInviteDelete: discord.GatewayIntentGuildInvites,
	eventVoiceStateUpdate: discord.GatewayIntentGuildVoiceStates,
	eventPresenceUpdate: discord.GatewayIntentGuildPresences,
	eventMessageCreate:     discord.GatewayIntentGuildMessages | discord.GatewayIntentDirectMessages,
	eventMessageUpdate:     discord.GatewayIntentGuildMessages | discord.GatewayIntentDirectMessages,
	eventMessageDelete:     discord.GatewayIntentGuildMessages | discord.GatewayIntentDirectMessages,
	eventMessageDeleteBulk: discord.GatewayIntentGuildMessages | discord.GatewayIntentDirectMessages,
	eventMessageReactionAdd:         discord.GatewayIntentGuildMessageReactions | discord.GatewayIntentDirectMessageReactions,
	eventMessageReactionRemove:      discord.GatewayIntentGuildMessageReactions | discord.GatewayIntentDirectMessageReactions,
	eventMessageReactionRemoveAll:   discord.GatewayIntentGuildMessageReactions | discord.GatewayIntentDirectMessageReactions,
	eventMessageReactionRemoveEmoji: discord.GatewayIntentGuildMessageReactions | discord.GatewayIntentDirectMessageReactions,
	eventTypingStart: discord.GatewayIntentGuildMessageTyping | discord.GatewayIntentDirectMessageTyping,
}
func (c *Client) registerHandler(event string, h handler) {
	c.mu.Lock()
	defer c.mu.Unlock()
	if missing := intents[event]; missing&c.intents == 0 {
		c.logger.Warnf("registering handler for event %q without required intent %q", event, missing)
	}
	if h == nil {
		panic("harmony: trying to register a nil event handler")
	}
	c.handlersMu.Lock()
	c.handlers[event] = h
	c.handlersMu.Unlock()
	c.logger.Debugf("registered handler for %s events", event)
}
type readyHandler func(*Ready)
func (h readyHandler) handle(v interface{}) {
	h(v.(*Ready))
}
func (c *Client) OnReady(f func(r *Ready)) {
	c.registerHandler(eventReady, readyHandler(f))
}
type channelCreateHandler func(*discord.Channel)
func (h channelCreateHandler) handle(v interface{}) {
	h(v.(*discord.Channel))
}
func (c *Client) OnChannelCreate(f func(c *discord.Channel)) {
	c.registerHandler(eventChannelCreate, channelCreateHandler(f))
}
type channelUpdateHandler func(*discord.Channel)
func (h channelUpdateHandler) handle(v interface{}) {
	h(v.(*discord.Channel))
}
func (c *Client) OnChannelUpdate(f func(c *discord.Channel)) {
	c.registerHandler(eventChannelUpdate, channelUpdateHandler(f))
}
type channelDeleteHandler func(*discord.Channel)
func (h channelDeleteHandler) handle(v interface{}) {
	h(v.(*discord.Channel))
}
func (c *Client) OnChannelDelete(f func(c *discord.Channel)) {
	c.registerHandler(eventChannelDelete, channelDeleteHandler(f))
}
type ChannelPinsUpdate struct {
	ChannelID        string       `json:"channel_id"`
	LastPinTimestamp discord.Time `json:"last_pin_timestamp"`
}
type channelPinsUpdateHandler func(*ChannelPinsUpdate)
func (h channelPinsUpdateHandler) handle(v interface{}) {
	h(v.(*ChannelPinsUpdate))
}
func (c *Client) OnChannelPinsUpdate(f func(cpu *ChannelPinsUpdate)) {
	c.registerHandler(eventChannelPinsUpdate, channelPinsUpdateHandler(f))
}
type guildCreateHandler func(*discord.Guild)
func (h guildCreateHandler) handle(v interface{}) {
	h(v.(*discord.Guild))
}
func (c *Client) OnGuildCreate(f func(g *discord.Guild)) {
	c.registerHandler(eventGuildCreate, guildCreateHandler(f))
}
type guildUpdateHandler func(*discord.Guild)
func (h guildUpdateHandler) handle(v interface{}) {
	h(v.(*discord.Guild))
}
func (c *Client) OnGuildUpdate(f func(g *discord.Guild)) {
	c.registerHandler(eventGuildUpdate, guildUpdateHandler(f))
}
type guildDeleteHandler func(*discord.UnavailableGuild)
func (h guildDeleteHandler) handle(v interface{}) {
	h(v.(*discord.UnavailableGuild))
}
func (c *Client) OnGuildDelete(f func(g *discord.UnavailableGuild)) {
	c.registerHandler(eventGuildDelete, guildDeleteHandler(f))
}
type GuildBan struct {
	*discord.User
	GuildID string `json:"guild_id"`
}
type guildBanAddHandler func(*GuildBan)
func (h guildBanAddHandler) handle(v interface{}) {
	h(v.(*GuildBan))
}
func (c *Client) OnGuildBanAdd(f func(ban *GuildBan)) {
	c.registerHandler(eventGuildBanAdd, guildBanAddHandler(f))
}
type guildBanRemoveHandler func(*GuildBan)
func (h guildBanRemoveHandler) handle(v interface{}) {
	h(v.(*GuildBan))
}
func (c *Client) OnGuildBanRemove(f func(ban *GuildBan)) {
	c.registerHandler(eventGuildBanRemove, guildBanRemoveHandler(f))
}
type GuildEmojis struct {
	Emojis  []discord.Emoji `json:"emojis"`
	GuildID string          `json:"guild_id"`
}
type guildEmojisUpdateHandler func(*GuildEmojis)
func (h guildEmojisUpdateHandler) handle(v interface{}) {
	h(v.(*GuildEmojis))
}
func (c *Client) OnGuildEmojisUpdate(f func(emojis *GuildEmojis)) {
	c.registerHandler(eventGuildEmojisUpdate, guildEmojisUpdateHandler(f))
}
type GuildIntegrationUpdate struct {
	GuildID string `json:"guild_id"`
}
type guildIntegrationUpdateHandler func(*GuildIntegrationUpdate)
func (h guildIntegrationUpdateHandler) handle(v interface{}) {
	h(v.(*GuildIntegrationUpdate))
}
func (c *Client) OnGuildIntegrationsUpdate(f func(u *GuildIntegrationUpdate)) {
	c.registerHandler(eventGuildIntegrationsUpdate, guildIntegrationUpdateHandler(f))
}
type GuildMemberAdd struct {
	*discord.GuildMember
	GuildID string `json:"guild_id"`
}
type guildMemberAddHandler func(*GuildMemberAdd)
func (h guildMemberAddHandler) handle(v interface{}) {
	h(v.(*GuildMemberAdd))
}
func (c *Client) OnGuildMemberAdd(f func(m *GuildMemberAdd)) {
	c.registerHandler(eventGuildMemberAdd, guildMemberAddHandler(f))
}
type GuildMemberRemove struct {
	User    *discord.User `json:"user"`
	GuildID string        `json:"guild_id"`
}
type guildMemberRemoveHandler func(*GuildMemberRemove)
func (h guildMemberRemoveHandler) handle(v interface{}) {
	h(v.(*GuildMemberRemove))
}
func (c *Client) OnGuildMemberRemove(f func(m *GuildMemberRemove)) {
	c.registerHandler(eventGuildMemberRemove, guildMemberRemoveHandler(f))
}
type GuildMemberUpdate struct {
	GuildID string        `json:"guild_id"`
	Roles   []string      `json:"roles"`
	User    *discord.User `json:"user"`
	Nick    string        `json:"nick"`
}
type guildMemberUpdateHandler func(*GuildMemberUpdate)
func (h guildMemberUpdateHandler) handle(v interface{}) {
	h(v.(*GuildMemberUpdate))
}
func (c *Client) OnGuildMemberUpdate(f func(m *GuildMemberUpdate)) {
	c.registerHandler(eventGuildMemberUpdate, guildMemberUpdateHandler(f))
}
type GuildMembersChunk struct {
	GuildID string                `json:"guild_id"`
	Members []discord.GuildMember `json:"members"`
}
type guildMembersChunkHandler func(*GuildMembersChunk)
func (h guildMembersChunkHandler) handle(v interface{}) {
	h(v.(*GuildMembersChunk))
}
func (c *Client) OnGuildMembersChunk(f func(m *GuildMembersChunk)) {
	c.registerHandler(eventGuildMembersChunk, guildMembersChunkHandler(f))
}
type GuildRole struct {
	GuildID string        `json:"guild_id"`
	Role    *discord.Role `json:"role"`
}
type guildRoleCreateHandler func(*GuildRole)
func (h guildRoleCreateHandler) handle(v interface{}) {
	h(v.(*GuildRole))
}
func (c *Client) OnGuildRoleCreate(f func(r *GuildRole)) {
	c.registerHandler(eventGuildRoleCreate, guildRoleCreateHandler(f))
}
type guildRoleUpdateHandler func(*GuildRole)
func (h guildRoleUpdateHandler) handle(v interface{}) {
	h(v.(*GuildRole))
}
func (c *Client) OnGuildRoleUpdate(f func(r *GuildRole)) {
	c.registerHandler(eventGuildRoleUpdate, guildRoleUpdateHandler(f))
}
type GuildRoleDelete struct {
	GuildID string `json:"guild_id"`
	RoleID  string `json:"role_id"`
}
type guildRoleDeleteHandler func(*GuildRoleDelete)
func (h guildRoleDeleteHandler) handle(v interface{}) {
	h(v.(*GuildRoleDelete))
}
func (c *Client) OnGuildRoleDelete(f func(r *GuildRoleDelete)) {
	c.registerHandler(eventGuildRoleDelete, guildRoleDeleteHandler(f))
}
type GuildInviteCreate struct {
	ChannelID      string        `json:"channel_id"`
	Code           string        `json:"code"`
	CreatedAt      discord.Time  `json:"created_at"`
	GuildID        string        `json:"guild_id"`
	Inviter        *discord.User `json:"inviter"`
	MaxAge         int           `json:"max_age"`
	MaxUses        int           `json:"max_uses"`
	TargetUser     *discord.User `json:"target_user"`
	TargetUserType int           `json:"target_user_type"`
	Temporary      bool          `json:"temporary"`
	Uses           int           `json:"uses"`
}
type guildInviteCreateHandler func(*GuildInviteCreate)
func (h guildInviteCreateHandler) handle(v interface{}) {
	h(v.(*GuildInviteCreate))
}