parent
4e11e29f70
commit
be3dfb251d
|
@ -181,13 +181,15 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
|
||||||
// sends a EVENT_AVATAR_DOWNLOAD message to the gateway if successful.
|
// sends a EVENT_AVATAR_DOWNLOAD message to the gateway if successful.
|
||||||
// logs an error message if it fails
|
// logs an error message if it fails
|
||||||
func (b *Btelegram) handleDownloadAvatar(userid int, channel string) {
|
func (b *Btelegram) handleDownloadAvatar(userid int, channel string) {
|
||||||
rmsg := config.Message{Username: "system",
|
rmsg := config.Message{
|
||||||
Text: "avatar",
|
Username: "system",
|
||||||
Channel: channel,
|
Text: "avatar",
|
||||||
Account: b.Account,
|
Channel: channel,
|
||||||
UserID: strconv.Itoa(userid),
|
Account: b.Account,
|
||||||
Event: config.EventAvatarDownload,
|
UserID: strconv.Itoa(userid),
|
||||||
Extra: make(map[string][]interface{})}
|
Event: config.EventAvatarDownload,
|
||||||
|
Extra: make(map[string][]interface{}),
|
||||||
|
}
|
||||||
|
|
||||||
if _, ok := b.avatarMap[strconv.Itoa(userid)]; !ok {
|
if _, ok := b.avatarMap[strconv.Itoa(userid)]; !ok {
|
||||||
photos, err := b.c.GetUserProfilePhotos(tgbotapi.UserProfilePhotosConfig{UserID: userid, Limit: 1})
|
photos, err := b.c.GetUserProfilePhotos(tgbotapi.UserProfilePhotosConfig{UserID: userid, Limit: 1})
|
||||||
|
@ -413,7 +415,7 @@ func (b *Btelegram) handleQuote(message, quoteNick, quoteMessage string) string
|
||||||
if format == "" {
|
if format == "" {
|
||||||
format = "{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})"
|
format = "{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})"
|
||||||
}
|
}
|
||||||
quoteMessagelength := len(quoteMessage)
|
quoteMessagelength := len([]rune(quoteMessage))
|
||||||
if b.GetInt("QuoteLengthLimit") != 0 && quoteMessagelength >= b.GetInt("QuoteLengthLimit") {
|
if b.GetInt("QuoteLengthLimit") != 0 && quoteMessagelength >= b.GetInt("QuoteLengthLimit") {
|
||||||
runes := []rune(quoteMessage)
|
runes := []rune(quoteMessage)
|
||||||
quoteMessage = string(runes[0:b.GetInt("QuoteLengthLimit")])
|
quoteMessage = string(runes[0:b.GetInt("QuoteLengthLimit")])
|
||||||
|
|
Loading…
Reference in New Issue