mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-26 14:09:41 +01:00
Allow PrefixMessagesWithNick on Telegram
This makes the PrefixMessagesWithNick setting work for messages relayed to Telegram, similar to how they work for messages relayed to mattermost (it is in fact copied from the mattermost bridge implementation). I believe this logic should be moved up the stack and not left to individual bridge implementations, but adding it here like this made it quickly work for my use-case (I don't have the time to dig in deeper and refactor everything).
This commit is contained in:
parent
20c04f7977
commit
f8537c63a5
@ -57,7 +57,12 @@ func (b *Btelegram) Send(msg config.Message) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
m := tgbotapi.NewMessage(chatid, msg.Text)
|
||||
|
||||
message := msg.Text
|
||||
if b.Config.PrefixMessagesWithNick {
|
||||
message = msg.Username + " " + message
|
||||
}
|
||||
m := tgbotapi.NewMessage(chatid, message)
|
||||
_, err = b.c.Send(m)
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user