summaryrefslogtreecommitdiffstats
path: root/bridge/discord/discord.go
diff options
context:
space:
mode:
authorQais Patankar <qaisjp@gmail.com>2019-10-03 23:18:56 +0100
committerWim <wim@42.be>2019-10-04 00:18:56 +0200
commitba6759010bc3c1c6b2793b3fdf92f8dadf481117 (patch)
tree8d04845d26ae6736bb04d167fecce80c74872569 /bridge/discord/discord.go
parentda3868c104f9e044b97c86c93a88843b7d8d4ead (diff)
downloadmatterbridge-msglm-ba6759010bc3c1c6b2793b3fdf92f8dadf481117.tar.gz
matterbridge-msglm-ba6759010bc3c1c6b2793b3fdf92f8dadf481117.tar.bz2
matterbridge-msglm-ba6759010bc3c1c6b2793b3fdf92f8dadf481117.zip
Add UserTypingSupport (discord) (#914)
* Add Discord to UserTypingSupport * discord: start typing in a channel on EventUserTyping receive * discord: emit EventUserTyping to gateway
Diffstat (limited to 'bridge/discord/discord.go')
-rw-r--r--bridge/discord/discord.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go
index 84171fa5..1c6c40d9 100644
--- a/bridge/discord/discord.go
+++ b/bridge/discord/discord.go
@@ -72,6 +72,7 @@ func (b *Bdiscord) Connect() error {
}
b.Log.Info("Connection succeeded")
b.c.AddHandler(b.messageCreate)
+ b.c.AddHandler(b.messageTyping)
b.c.AddHandler(b.memberUpdate)
b.c.AddHandler(b.messageUpdate)
b.c.AddHandler(b.messageDelete)
@@ -188,6 +189,14 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) {
return "", fmt.Errorf("Could not find channelID for %v", msg.Channel)
}
+ if msg.Event == config.EventUserTyping {
+ if b.GetBool("ShowUserTyping") {
+ err := b.c.ChannelTyping(channelID)
+ return "", err
+ }
+ return "", nil
+ }
+
// Make a action /me of the message
if msg.Event == config.EventUserAction {
msg.Text = "_" + msg.Text + "_"