func (h guildEmojisUpdateHandler) handle(v interface{}) {
	h(v.(*GuildEmojis))
}
handle implements the handler interface.
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)