Skip to content

Commit

Permalink
cleanup interaction events
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Apr 10, 2023
1 parent e4caa2f commit 83a467e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions events/interaction_events.go
Expand Up @@ -28,7 +28,7 @@ func (e *InteractionCreate) Guild() (discord.Guild, bool) {
// MessageChannel returns the discord.GuildMessageChannel that the interaction happened in.
// This only returns cached channels.
func (e *InteractionCreate) MessageChannel() (discord.GuildMessageChannel, bool) {
return e.Client().Caches().GuildMessageChannel(e.ChannelID())
return e.Client().Caches().GuildMessageChannel(e.Channel().ID)
}

// ApplicationCommandInteractionCreate is the base struct for all application command interaction create events.
Expand All @@ -51,7 +51,7 @@ func (e *ApplicationCommandInteractionCreate) Guild() (discord.Guild, bool) {
// MessageChannel returns the discord.GuildMessageChannel that the interaction happened in.
// This only returns cached channels.
func (e *ApplicationCommandInteractionCreate) MessageChannel() (discord.GuildMessageChannel, bool) {
return e.Client().Caches().GuildMessageChannel(e.ApplicationCommandInteraction.Channel().ID)
return e.Client().Caches().GuildMessageChannel(e.Channel().ID)
}

// CreateMessage responds to the interaction with a new message.
Expand Down Expand Up @@ -93,7 +93,7 @@ func (e *ComponentInteractionCreate) Guild() (discord.Guild, bool) {
// MessageChannel returns the discord.GuildMessageChannel that the interaction happened in.
// This only returns cached channels.
func (e *ComponentInteractionCreate) MessageChannel() (discord.GuildMessageChannel, bool) {
return e.Client().Caches().GuildMessageChannel(e.ComponentInteraction.Channel().ID)
return e.Client().Caches().GuildMessageChannel(e.Channel().ID)
}

// CreateMessage responds to the interaction with a new message.
Expand Down Expand Up @@ -145,7 +145,7 @@ func (e *AutocompleteInteractionCreate) Guild() (discord.Guild, bool) {
// MessageChannel returns the discord.GuildMessageChannel that the interaction happened in.
// This only returns cached channels.
func (e *AutocompleteInteractionCreate) MessageChannel() (discord.GuildMessageChannel, bool) {
return e.Client().Caches().GuildMessageChannel(e.AutocompleteInteraction.Channel().ID)
return e.Client().Caches().GuildMessageChannel(e.Channel().ID)
}

// Result responds to the interaction with a slice of choices.
Expand Down Expand Up @@ -173,7 +173,7 @@ func (e *ModalSubmitInteractionCreate) Guild() (discord.Guild, bool) {
// MessageChannel returns the discord.GuildMessageChannel that the interaction happened in.
// This only returns cached channels.
func (e *ModalSubmitInteractionCreate) MessageChannel() (discord.GuildMessageChannel, bool) {
return e.Client().Caches().GuildMessageChannel(e.ModalSubmitInteraction.Channel().ID)
return e.Client().Caches().GuildMessageChannel(e.Channel().ID)
}

// CreateMessage responds to the interaction with a new message.
Expand Down

0 comments on commit 83a467e

Please sign in to comment.