[fix] discord: send comments in extras

This commit is contained in:
soloam
2021-12-08 23:21:46 +00:00
parent 2be3c39689
commit fb24d4f9d2
3 changed files with 5 additions and 9 deletions

3
.gitignore vendored
View File

@@ -4,3 +4,6 @@
# Exclude configuration file
matterbridge.toml
# Exclude IDE Files
.vscode

View File

@@ -82,10 +82,8 @@ func (b *Bdiscord) webhookSend(msg *config.Message, channelID string) (*discordg
ContentType: "",
Reader: bytes.NewReader(*fi.Data),
}
content := ""
if msg.Text == "" {
content = fi.Comment
}
content := fi.Comment
_, e2 := b.transmitter.Send(
channelID,
&discordgo.WebhookParams{

View File

@@ -162,11 +162,6 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
// handle entities (adding URLs)
b.handleEntities(&rmsg, message)
// handle Comments
if rmsg.Comment != "" {
rmsg.Text = rmsg.Text + "\n" + rmsg.Comment
}
if rmsg.Text != "" || len(rmsg.Extra) > 0 {
rmsg.Text = helper.RemoveEmptyNewLines(rmsg.Text)