summaryrefslogtreecommitdiffstats
path: root/bridge/discord/discord.go
Commit message (Collapse)AuthorAgeFilesLines
* Ignore events from other guilds, add nosendjoinpart support (discord) (#1846)Sam W2022-06-241-1/+1
| | | | | | | | | | | | | | | | * discord: add nosendjoinpart support This allows the discord bridge to be configured with `nosendjoinpart`, preventing discord-originating join/part messages from being send to other bridged platforms. * discord: Ignore incoming events for other guilds Ignore all incoming discord events originating from Guild IDs other than the one we have configured. This is necessary because discord bots receive events for *all* discord guilds that they are present in. Fixes #1612
* Add KeepQuotedReply option for matrix to fix regression (#1823)Wim2022-05-061-2/+0
| | | | | | | | | | | | Matrix quotes replies and as of matterbridge 1.24.0 we strip those as this causes issues with bridges support threading and have PreserveThreading enabled. Introduced via https://github.com/42wim/matterbridge/commit/9a8ce9b17e560433731eb5efa3cee7ced0b93605 But if you for example use mattermost or discord with webhooks you'll need to enable this if you want something that looks like a reply from matrix. See issues: - https://github.com/42wim/matterbridge/issues/1819 - https://github.com/42wim/matterbridge/issues/1780
* Change discord non-native threading behaviour (discord) (#1791)Wim2022-04-041-1/+2
| | | | | | | | Sorta regression introduced by 9a8ce9b17e560433731eb5efa3cee7ced0b93605 which changes the way we get replies of matrix. This causes issues like https://github.com/42wim/matterbridge/issues/1780 We "fix" this by mimicking the old behaviour when "PreserveThreading" is disabled.
* Switch to discordgo upstream again (#1759)Wim2022-03-121-1/+1
| | | | | * Switch to upstream discordgo again * Fix discord api changes
* Add more debug options for discord (#1712)Wim2022-02-061-1/+4
| | | | | debuglevel=1 dumps every received discord event debuglevel=2 dumps every discord event we are sending to discord (also logs sensitive information)
* Add support for deleting files from slack to discord. Fixes #1705 (#1709)Wim2022-02-051-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | We create a new event EventFileDelete which will be used to delete specific uploaded files using the Extra["file"] in the config.Message. We also add a new NativeID key to the FileInfo struct which will contain the native file ID of the sending bridge. When a new file is added to the config.Message.Extra["file"] map, now the bridge native file ID should be added here. When the receiving bridge receives such a message, it should keep an internal mapping of NativeID <> bridge fileid/message id. In the case of discord we map it to the resulted discord message ID after uploading it. Now when a bridge deletes a file, it should send a EventFileDelete and setting the ID to the native file ID of the bridge. When the receiving bridge will get this event it'll look into the NativeID <> bridge id mapping to find their internal ID and use it to delete the specific file on their side. For now this is implemented for slack to discord but this will be add to other bridges where useful.
* Add a MessageClipped option to set your own clipped message. Closes #1359 ↵Wim2021-05-271-2/+2
| | | | (#1487)
* discord: Add AllowMention to restrict allowed mentions (#1462)Alexandre GV2021-05-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | * Add DisablePingEveryoneHere/DisablePingRoles/DisablePingUsers keys to config * Add basic AllowedMentions behavior to discord webhooks * Initialize b.AllowedMentions on Discord Bridger init * Call b.getAllowedMentions on each webhook to allow config hot reloading * Add AllowedMentions on all Discord webhooks/messages * Add DisablePingEveryoneHere/DisablePingRoles/DisablePingUsers to matterbridge.toml.sample * Change 'Disable' for 'Allow' and revert logic in Discord AllowedMentions * Update Discord AllowedMentions in matterbridge.toml.sample * Fix typo in DisableWebPagePreview * Replace 'AllowPingEveryoneHere' with 'AllowPingEveryone' * Replace 3 AllowPingEveryone/Roles/Users bools with an array * Fix typo
* Declare GUILD_MEMBERS privileged intent (discord) (#1428)James Lu2021-03-201-0/+5
| | | | | | | | Without this declared, it seems that Discord will not send any member update events after connection, even if the privileged gateway intent is enabled for the bot in settings. This causes nick tracking to get out of sync when people change their nicks after the bot connects. See: https://discord.com/developers/docs/topics/gateway#gateway-intents
* Add an even more debug option (discord) (#1368)Wim2021-01-231-0/+5
| | | Enable discordgo debugging with debuglevel=1 under the [discord.xxx] section, for even more debugging fun.
* Refactor "msg-parent-not-found" to config.ParentIDNotFound (#1347)Qais Patankar2020-12-311-2/+2
|
* Add a prefix handler for unthreaded messages (discord) (#1346)Qais Patankar2020-12-311-0/+6
|
* Add threading support with token (discord) (#1342)Wim2020-12-311-2/+15
| | | | | | | | Webhooks don't support the threading yet, so this is token only. In discord you can reply on each message of a thread, but this is not possible in mattermost (so some changes added there to make sure we always answer on the rootID of the thread). Also needs some more testing with slack. update : It now also uses the token when replying to a thread (even if webhooks are enabled), until webhooks have support for threads.
* Update webhook documentation (discord) (#1335)Qais Patankar2020-12-171-5/+0
|
* Split Bdiscord.Send into handleEventWebhook and handleEventBotUser (discord)Qais Patankar2020-12-131-43/+8
|
* Move webhook specific logic to its own file (discord)Qais Patankar2020-12-131-94/+0
|
* Extract maybeGetLocalAvatar into its own function (discord)Qais Patankar2020-12-131-15/+17
|
* Remove WebhookURL support (discord)Qais Patankar2020-12-131-8/+14
|
* Add initial transmitter implementation (discord)Qais Patankar2020-12-131-116/+78
| | | | | | This has been tested with one webhook in one channel. Sends, edits and deletions work fine
* Revert "Disable webhook editing (#1296)" (discord)Qais Patankar2020-12-131-10/+6
| | | | This reverts commit c23252ab53182cc6e68086f29c7137fbc27917ee.
* Refactor guild finding code (discord) (#1319)Qais Patankar2020-12-031-18/+35
|
* Disable webhook editing (discord) (#1296)Wim2020-11-221-6/+10
| | | | | | | See https://github.com/42wim/matterbridge/issues/1255 and https://github.com/qaisjp/go-discord-irc/issues/57 Webhook edits gets ratelimited which cause other problems with matterbridge. Disabling for now.
* Update webhook messages via new endpoint (discord)Simon THOBY2020-11-141-22/+17
| | | | | | | | | | | | When using the webhook, the previous method to edit a message was to delete the old one via the classical API, and to create a new message via the webhook. While this works, this means that editing "old" messages lead to a mess where the chronological order is no longer respected. This uses an hidden API explained in https://support.discord.com/hc/en-us/community/posts/360034557771 to achieve a proper edition using the webhook API. The obvious downside of this approach is that since it is an undocumented API for now, so there is no stability guarantee :/
* Fix webhook EventUserAction messages being skipped (discord) (#1133)Qais Patankar2020-05-111-1/+1
| | | Fixes #1132
* Add an ID cache (discord). Fixes #1106 (#1111)Wim2020-04-211-0/+9
| | | | | | | | When a webhook "edits" a message, it does this by deleting the message and creating a new one with the new content. On creation of this new message, we'll get another ID then already is know by the gateway in its id cache. So we add it in our own cache and replace it whenever we want to edit/delete it again.
* Don't transmit typing events from ourselves (slack/discord) (#1056)Qais Patankar2020-03-221-0/+2
|
* Refactor webhook permission checksQais Patankar2020-03-181-8/+10
|
* Fix #1040: spotty webhook permission verificationQais Patankar2020-03-181-3/+7
|
* Remove replace directives and use own fork to make go get work again (#1028)Wim2020-03-081-1/+1
| | | | See https://github.com/golang/go/issues/30354 go get doesn't honor the go.mod replace options.
* Add ability to procure avatars from the destination bridge (#1000)Qais Patankar2020-02-091-0/+21
| | | | | | | | | | | | * remote_avatar: add UseLocalAvatar * remote_avatar: make sure msg.Protocol is always set correctly * remote_avatars: support msg.Account * remote_avatar: add to matterbridge.toml.sample * remote_avatar: clarify something
* Check only bridged channels for PermManageWebhooks (discord) (#1001)Qais Patankar2020-02-081-4/+5
| | | | | | * Check only bridged channels for PermManageWebhooks * add note
* Show file comment in webhook if normal message is empty (discord). Fixes ↵Wim2020-02-021-0/+5
| | | | #962 (#995)
* Fix channel ID problem with multiple gateways (discord). Fixes #953 (#977)Wim2020-01-091-5/+0
|
* Remove obsolete file upload links (discord). Fixes #908 (#931)Wim2019-10-271-12/+0
| | | | Since v1.16.0 we now can upload files via webhook. Old way of showing files with webhook only setup can be removed.
* Add UserTypingSupport (discord) (#914)Qais Patankar2019-10-041-0/+9
| | | | | | | | * Add Discord to UserTypingSupport * discord: start typing in a channel on EventUserTyping receive * discord: emit EventUserTyping to gateway
* Add support for sending files via webhook (discord) (#872)MOZGIII2019-08-291-12/+68
|
* Add support for discord category channels (discord) (#863)Wim2019-07-151-3/+1
| | | | | | | | | | | | | | This adds support for the discord category option that can be used to group channels in. This means we can have multiple channels with the same name. We add the option to specify a category in the channel option of a discord account under [[gateway]] Besides channel="channel" or channel="ID:channelID", now also channel="category/channel" can be specified. This change remains backwards compatible with people that haven't specified the category and incorporates the fix in #861
* Fix discord channel & category name clash. #860 (#861)Qais Patankar2019-07-141-3/+5
|
* Support webhook message deletions (discord) (#853)Qais Patankar2019-07-081-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support webhook message deletions (discord) Messages sent via webhook can now be deleted. It seems it can do this without any special permissions. This copies discordgo.WebhookExecute and makes it support the returning of discordgo.Message. A pull request has been sent upstream, so we should use that if @bwmariin accepts the pull request: https://github.com/bwmarrin/discordgo/pull/663 Changes in behaviour (webhook mode only): - Previously messages *edited* on other platforms would just be retransmitted as a brand new message to Discord. - Message *edits* will now be ignored. - Debug: message edits will now print out a "permission error". In the future it may be good to send an "message edited" react to those webhook messages, so at least people know that the message was edited on other platforms. (Even though it can't actually show the new message.) Alternatively, message edits could just send a brand new message with a link back to the old one. This is a little ugly but it would ensure that Discord users are able to see the edited message. These "message edit notifications" would be sent from the bot user (not from a webhook), so we could edit the "edit notification" if subsequent edits to the original message are made.
* Support bulk deletions (discord)Qais Patankar2019-06-161-0/+1
|
* Print errors as string instead of %#v (#738)Wim2019-02-261-3/+3
|
* Support join/leaves from discord. Closes #654 (#721)Wim2019-02-171-0/+2
|
* Make discord user token work correctly (discord) #689Wim2019-01-191-2/+2
|
* Run go fmtWim2019-01-141-3/+3
|
* Allow to bridge non-bot Discord users (discord) (#689)Zomboy Alfrir2019-01-141-0/+5
| | | | | | If you prefix a token with `User ` it'll treat is as a user token. Co-Authored-By: zomboy-alfrir <zomboy@dancodes.com.ar>
* Use only one webhook if possible (discord) (#681)James Nylen2019-01-091-8/+42
|
* Add file comment to webhook messages (discord). Fixes #358Wim2019-01-071-1/+7
|
* Improve error reporting on failure to join Discord. Fixes #672 (#680)James Nylen2019-01-071-1/+15
|
* Split Discord bridge in multiple files (#632)Duco van Amstel2018-12-071-257/+52
|
* Fix regression on using server ID (discord). #619 #617Wim2018-11-281-1/+2
|