From ba6759010bc3c1c6b2793b3fdf92f8dadf481117 Mon Sep 17 00:00:00 2001 From: Qais Patankar Date: Thu, 3 Oct 2019 23:18:56 +0100 Subject: Add UserTypingSupport (discord) (#914) * Add Discord to UserTypingSupport * discord: start typing in a channel on EventUserTyping receive * discord: emit EventUserTyping to gateway --- bridge/discord/handlers.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bridge/discord/handlers.go') 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 -- cgit v1.2.3