State: Fixed Discord not setting GuildID for Ready.Guild.Channels

This commit is contained in:
diamondburned (Forefront) 2020-05-17 23:11:14 -07:00
parent 64c6ca7916
commit 53c1ea0f0d
1 changed files with 5 additions and 1 deletions

View File

@ -333,7 +333,11 @@ func handleGuildCreate(store Store, guild *gateway.GuildCreateEvent) []error {
// Handle guild channels
for i := range guild.Channels {
if err := store.ChannelSet(&guild.Channels[i]); err != nil {
// I HATE Discord.
ch := guild.Channels[i]
ch.GuildID = guild.ID
if err := store.ChannelSet(&ch); err != nil {
error(err, "failed to set guild channel in Ready")
}
}