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
* 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.
Actually check if we're connected when trying to Send() a message.
Messages now will get dropped when not connected.
TODO: Ideally this should be in a ring buffer to retransmit when the
connection comes back up.
Fixes issue #814.
This is a somewhat hacky way of achieving the required goal but it seems
like this is the least problematic way of getting there.
We might want to redesign some bridge information later such that we
have a standardised way of specifying what is and what isn't supported
by each chat protocol / bridge.
Adds a new key OutMessage under [tengo] table, which specifies the location of the script that
will be invoked on each message being sent to a bridge and can be used to modify the Username
and the Text of that message.
The script will have the following global variables:
read-only:
inAccount, inProtocol, inChannel, inGateway
outAccount, outProtocol, outChannel, outGateway
read-write:
msgText, msgUsername
The script is reloaded on every message, so you can modify the script on the fly.
The default script in https://github.com/42wim/matterbridge/tree/master/internal/tengo/outmessage.tengo
is compiled in and will be executed if no script is specified.