diff options
author | Qais Patankar <qaisjp@gmail.com> | 2019-10-03 23:18:56 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2019-10-04 00:18:56 +0200 |
commit | ba6759010bc3c1c6b2793b3fdf92f8dadf481117 (patch) | |
tree | 8d04845d26ae6736bb04d167fecce80c74872569 /bridge/discord/handlers.go | |
parent | da3868c104f9e044b97c86c93a88843b7d8d4ead (diff) | |
download | matterbridge-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/handlers.go')
-rw-r--r-- | bridge/discord/handlers.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bridge/discord/handlers.go b/bridge/discord/handlers.go index cfda2de9..9260427d 100644 --- a/bridge/discord/handlers.go +++ b/bridge/discord/handlers.go @@ -37,6 +37,19 @@ func (b *Bdiscord) messageDeleteBulk(s *discordgo.Session, m *discordgo.MessageD } } +func (b *Bdiscord) messageTyping(s *discordgo.Session, m *discordgo.TypingStart) { + if !b.GetBool("ShowUserTyping") { + return + } + + rmsg := config.Message{Account: b.Account, Event: config.EventUserTyping} + rmsg.Channel = b.getChannelName(m.ChannelID) + if b.useChannelID { + rmsg.Channel = "ID:" + m.ChannelID + } + b.Remote <- rmsg +} + func (b *Bdiscord) messageUpdate(s *discordgo.Session, m *discordgo.MessageUpdate) { //nolint:unparam if b.GetBool("EditDisable") { return |