From 7b7837fc91206174432c46444a1cbcf546ae33dc Mon Sep 17 00:00:00 2001 From: KOUNOIKE Yuusuke Date: Sun, 26 Mar 2023 18:26:52 +0900 Subject: [PATCH] =?UTF-8?q?cache=E3=81=AEupdate=E3=81=ABdiscord=E3=81=AB?= =?UTF-8?q?=E5=95=8F=E3=81=84=E5=90=88=E3=82=8F=E3=81=9B=E3=81=AB=E8=A1=8C?= =?UTF-8?q?=E3=81=8F=E3=81=AE=E3=82=92=E3=82=84=E3=82=81=E3=81=A6=E8=87=AA?= =?UTF-8?q?=E5=88=86=E3=81=A7=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- discord/discord_client/discordclient.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/discord_client/discordclient.go b/discord/discord_client/discordclient.go index 4939502..ebadaf7 100644 --- a/discord/discord_client/discordclient.go +++ b/discord/discord_client/discordclient.go @@ -105,7 +105,7 @@ func (d *DiscordClient) GetCachedChannel(origCategory string, origChannelName st if err != nil { return nil, err } - d.UpdateChannelsCache() + d.channelsCache = append(d.channelsCache, categoryChannel) data := discordgo.GuildChannelCreateData{ Name: channel, Type: discordgo.ChannelTypeGuildText, @@ -115,7 +115,7 @@ func (d *DiscordClient) GetCachedChannel(origCategory string, origChannelName st if err != nil { return nil, err } - d.UpdateChannelsCache() + d.channelsCache = append(d.channelsCache, createdChannel) d.logger.Debug("GuildChannelCreateComplex OK", zap.String("name", channel), zap.String("cacheKey", cacheKey), zap.String("created ch.Name", createdChannel.Name)) d.channelIDCache[cacheKey] = createdChannel return createdChannel, nil @@ -135,7 +135,7 @@ func (d *DiscordClient) GetCachedChannel(origCategory string, origChannelName st if err != nil { return nil, err } - d.UpdateChannelsCache() + d.channelsCache = append(d.channelsCache, ch) d.logger.Debug("GuildChannelCreateComplex OK", zap.String("origChannelName", origChannelName), zap.String("cacheKey", cacheKey), zap.String("created ch.Name", ch.Name)) d.channelIDCache[cacheKey] = ch return ch, nil