From 265457b45171dcae96a1aac9454e3bda2cd0557a Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 19 Dec 2017 23:15:03 +0100 Subject: Refactor and add MediaDownloadSize to General --- bridge/discord/discord.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'bridge/discord') diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 183b1193..a5e20758 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -12,9 +12,6 @@ import ( type bdiscord struct { c *discordgo.Session - Config *config.Protocol - Remote chan config.Message - Account string Channels []*discordgo.Channel Nick string UseChannelID bool @@ -24,6 +21,7 @@ type bdiscord struct { webhookToken string channelInfoMap map[string]*config.ChannelInfo sync.RWMutex + *config.BridgeConfig } var flog *log.Entry @@ -33,11 +31,8 @@ func init() { flog = log.WithFields(log.Fields{"module": protocol}) } -func New(cfg config.Protocol, account string, c chan config.Message) *bdiscord { - b := &bdiscord{} - b.Config = &cfg - b.Remote = c - b.Account = account +func New(cfg *config.BridgeConfig) *bdiscord { + b := &bdiscord{BridgeConfig: cfg} b.userMemberMap = make(map[string]*discordgo.Member) b.channelInfoMap = make(map[string]*config.ChannelInfo) if b.Config.WebhookURL != "" { -- cgit v1.2.3