summaryrefslogtreecommitdiffstats
path: root/bridge/discord/helpers.go
Commit message (Collapse)AuthorAgeFilesLines
* Switch to discordgo upstream again (#1759)Wim2022-03-121-1/+1
| | | | | * Switch to upstream discordgo again * Fix discord api changes
* discord: Add AllowMention to restrict allowed mentions (#1462)Alexandre GV2021-05-131-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Add initial transmitter implementation (discord)Qais Patankar2020-12-131-3/+3
| | | | | | This has been tested with one webhook in one channel. Sends, edits and deletions work fine
* Update webhook messages via new endpoint (discord)Simon THOBY2020-11-141-34/+0
| | | | | | | | | | | | 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 #1120: replaceAction "_" crash (discord) (#1121)Qais Patankar2020-04-251-2/+3
|
* Add an ID cache (discord). Fixes #1106 (#1111)Wim2020-04-211-0/+34
| | | | | | | | 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.
* Strip extra info from emotes (discord) (#1052)Qais Patankar2020-03-221-0/+5
|
* 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.
* Fix channel ID problem with multiple gateways (discord). Fixes #953 (#977)Wim2020-01-091-0/+7
|
* move stripCustomoji logic to default Tengo script (#973)c0ncord22020-01-091-5/+0
| | | | | | | | | | | | * move stripCustomoji logic to default Tengo script Removing the image ID from the message (without any possibility of recovering it later) is a loss of valuable data that prevents users from giving support to custom emoji via Tengo scripts. * bugfix - do send colors to other irc bridges "if we're not sending to an irc bridge we strip the IRC colors" Co-authored-by: c0ncord <59654954+c0ncord@users.noreply.github.com>
* Specify correct GuildID on unknown user query (discord). Fixes #879 (#894)Wim2019-09-151-3/+3
|
* Add extra debug info (discord)Wim2019-09-051-1/+1
|
* Add support for sending files via webhook (discord) (#872)MOZGIII2019-08-291-24/+0
|
* Fix regression (discord). Closes #864 (#866)Wim2019-07-291-1/+1
|
* Add support for discord category channels (discord) (#863)Wim2019-07-151-20/+52
| | | | | | | | | | | | | | 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/+19
|
* Support webhook message deletions (discord) (#853)Qais Patankar2019-07-081-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Print errors as string instead of %#v (#738)Wim2019-02-261-1/+1
|
* Split Discord bridge in multiple files (#632)Duco van Amstel2018-12-071-0/+189