4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-09 12:44:04 +00:00

Add UserTypingSupport (discord) (#914)

* Add Discord to UserTypingSupport

* discord: start typing in a channel on EventUserTyping receive

* discord: emit EventUserTyping to gateway
This commit is contained in:
Qais Patankar
2019-10-03 23:18:56 +01:00
committed by Wim
parent da3868c104
commit ba6759010b
3 changed files with 24 additions and 1 deletions

View File

@ -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 + "_"