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.
This commit is contained in:
parent
09e3aacf88
commit
5a5a7734fd
1 changed files with 3 additions and 1 deletions
|
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue