diff options
author | Wim <wim@42.be> | 2022-03-12 17:06:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-12 17:06:39 +0100 |
commit | e4c0ca0f4807a36a6cc0ea5f793905539afa4648 (patch) | |
tree | cfaa8cb0c5650878047456f83b8e18299b15869d /bridge/discord | |
parent | 9c203327c07d8fd4161c47163f35dfea29ac83b1 (diff) | |
download | matterbridge-msglm-e4c0ca0f4807a36a6cc0ea5f793905539afa4648.tar.gz matterbridge-msglm-e4c0ca0f4807a36a6cc0ea5f793905539afa4648.tar.bz2 matterbridge-msglm-e4c0ca0f4807a36a6cc0ea5f793905539afa4648.zip |
Switch to discordgo upstream again (#1759)
* Switch to upstream discordgo again
* Fix discord api changes
Diffstat (limited to 'bridge/discord')
-rw-r--r-- | bridge/discord/discord.go | 2 | ||||
-rw-r--r-- | bridge/discord/handlers.go | 4 | ||||
-rw-r--r-- | bridge/discord/handlers_test.go | 2 | ||||
-rw-r--r-- | bridge/discord/helpers.go | 2 | ||||
-rw-r--r-- | bridge/discord/transmitter/transmitter.go | 2 | ||||
-rw-r--r-- | bridge/discord/transmitter/utils.go | 2 | ||||
-rw-r--r-- | bridge/discord/webhook.go | 4 |
7 files changed, 9 insertions, 9 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 4e86835b..1c2e8ca4 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -10,8 +10,8 @@ import ( "github.com/42wim/matterbridge/bridge/config" "github.com/42wim/matterbridge/bridge/discord/transmitter" "github.com/42wim/matterbridge/bridge/helper" + "github.com/bwmarrin/discordgo" lru "github.com/hashicorp/golang-lru" - "github.com/matterbridge/discordgo" ) const ( diff --git a/bridge/discord/handlers.go b/bridge/discord/handlers.go index 42c5f383..d2613e1a 100644 --- a/bridge/discord/handlers.go +++ b/bridge/discord/handlers.go @@ -2,8 +2,8 @@ package bdiscord import ( "github.com/42wim/matterbridge/bridge/config" + "github.com/bwmarrin/discordgo" "github.com/davecgh/go-spew/spew" - "github.com/matterbridge/discordgo" ) func (b *Bdiscord) messageDelete(s *discordgo.Session, m *discordgo.MessageDelete) { //nolint:unparam @@ -56,7 +56,7 @@ func (b *Bdiscord) messageUpdate(s *discordgo.Session, m *discordgo.MessageUpdat return } // only when message is actually edited - if m.Message.EditedTimestamp != "" { + if m.Message.EditedTimestamp != nil { b.Log.Debugf("Sending edit message") m.Content += b.GetString("EditSuffix") msg := &discordgo.MessageCreate{ diff --git a/bridge/discord/handlers_test.go b/bridge/discord/handlers_test.go index a809dadd..915d9b19 100644 --- a/bridge/discord/handlers_test.go +++ b/bridge/discord/handlers_test.go @@ -3,7 +3,7 @@ package bdiscord import ( "testing" - "github.com/matterbridge/discordgo" + "github.com/bwmarrin/discordgo" "github.com/stretchr/testify/assert" ) diff --git a/bridge/discord/helpers.go b/bridge/discord/helpers.go index 4e453ad7..2e18f46c 100644 --- a/bridge/discord/helpers.go +++ b/bridge/discord/helpers.go @@ -6,7 +6,7 @@ import ( "strings" "unicode" - "github.com/matterbridge/discordgo" + "github.com/bwmarrin/discordgo" ) func (b *Bdiscord) getAllowedMentions() *discordgo.MessageAllowedMentions { diff --git a/bridge/discord/transmitter/transmitter.go b/bridge/discord/transmitter/transmitter.go index f327dfb7..71407a1d 100644 --- a/bridge/discord/transmitter/transmitter.go +++ b/bridge/discord/transmitter/transmitter.go @@ -20,7 +20,7 @@ import ( "sync" "time" - "github.com/matterbridge/discordgo" + "github.com/bwmarrin/discordgo" log "github.com/sirupsen/logrus" ) diff --git a/bridge/discord/transmitter/utils.go b/bridge/discord/transmitter/utils.go index f42e81eb..042aa505 100644 --- a/bridge/discord/transmitter/utils.go +++ b/bridge/discord/transmitter/utils.go @@ -1,7 +1,7 @@ package transmitter import ( - "github.com/matterbridge/discordgo" + "github.com/bwmarrin/discordgo" ) // isDiscordPermissionError returns false for nil, and true if a Discord RESTError with code discordgo.ErrorCodeMissionPermissions diff --git a/bridge/discord/webhook.go b/bridge/discord/webhook.go index 3afb942d..c34fc945 100644 --- a/bridge/discord/webhook.go +++ b/bridge/discord/webhook.go @@ -5,7 +5,7 @@ import ( "github.com/42wim/matterbridge/bridge/config" "github.com/42wim/matterbridge/bridge/helper" - "github.com/matterbridge/discordgo" + "github.com/bwmarrin/discordgo" ) // shouldMessageUseWebhooks checks if have a channel specific webhook, if we're not using auto webhooks @@ -89,7 +89,7 @@ func (b *Bdiscord) webhookSend(msg *config.Message, channelID string) (*discordg &discordgo.WebhookParams{ Username: msg.Username, AvatarURL: msg.Avatar, - File: &file, + Files: []*discordgo.File{&file}, Content: content, AllowedMentions: b.getAllowedMentions(), }, |