Remove names from mastodon, fix images maybe?!
This commit is contained in:
parent
60b3fa2495
commit
6107a0495a
1 changed files with 6 additions and 3 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"git.fromouter.space/hamcha/tg"
|
||||
"github.com/mattn/go-mastodon"
|
||||
|
@ -112,7 +111,11 @@ func mastodon_message(broker *tg.Broker, update tg.APIMessage) {
|
|||
return
|
||||
}
|
||||
|
||||
status, err := sendToot(strings.TrimSpace(fmt.Sprintf("%s\n\n(da %s)", *(update.Caption), update.User.FirstName)), attach.ID)
|
||||
text := ""
|
||||
if update.Caption != nil {
|
||||
text = *(update.Caption)
|
||||
}
|
||||
status, err := sendToot(text, attach.ID)
|
||||
if err != nil {
|
||||
log.Printf("[mastodon] Send toot failed: %s\n", err.Error())
|
||||
broker.SendTextMessage(update.Chat, "<b>ERRORE!</b> @hamcha controlla la console!", &tg.MessageOptions{
|
||||
|
@ -127,7 +130,7 @@ func mastodon_message(broker *tg.Broker, update tg.APIMessage) {
|
|||
return
|
||||
}
|
||||
|
||||
status, err := sendToot(fmt.Sprintf("%s\n\n(da %s)", *(update.Text), update.User.FirstName), "")
|
||||
status, err := sendToot(*(update.Text), "")
|
||||
if err != nil {
|
||||
log.Printf("[mastodon] Send toot failed: %s\n", err.Error())
|
||||
broker.SendTextMessage(update.Chat, "<b>ERRORE!</b> @hamcha controlla la console!", &tg.MessageOptions{
|
||||
|
|
Reference in a new issue