From 5a5a7734fd817f40b84fe6efe96a227d423e6d4d Mon Sep 17 00:00:00 2001 From: damon Date: Wed, 4 Mar 2026 22:11:53 +0800 Subject: [PATCH] feat(discord): add configuration support for Discord channel proxy settings - Introduced a config field in the DiscordChannel struct to manage proxy settings. - Updated the downloadAttachment method to utilize the new configuration for proxy URLs. --- pkg/channels/discord/discord.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/channels/discord/discord.go b/pkg/channels/discord/discord.go index e09f67a65..2dfb3df78 100644 --- a/pkg/channels/discord/discord.go +++ b/pkg/channels/discord/discord.go @@ -29,6 +29,7 @@ const ( type DiscordChannel struct { *channels.BaseChannel session *discordgo.Session + config *config.Config ctx context.Context cancel context.CancelFunc typingMu sync.Mutex @@ -57,6 +58,7 @@ func NewDiscordChannel(cfg *config.Config, bus *bus.MessageBus) (*DiscordChannel return &DiscordChannel{ BaseChannel: base, session: session, + config: cfg, ctx: context.Background(), typingStop: make(map[string]chan struct{}), commands: commands, @@ -492,7 +494,7 @@ func (c *DiscordChannel) StartTyping(ctx context.Context, chatID string) (func() func (c *DiscordChannel) downloadAttachment(url, filename string) string { return utils.DownloadFile(url, filename, utils.DownloadOptions{ LoggerPrefix: "discord", - ProxyURL: c.config.Proxy, + ProxyURL: c.config.Channels.Discord.Proxy, }) }