HarukaNetwork/HarukaX

cannot set new welcome msgID when updating the cleanwelcome msgid due to welcome msg did not send

soekarnohatta opened this issue · 0 comments

This happened when the welcome message did not send by the bot and when the bot sets the new welcome msgid, the error occured. To reproduce it, turn the bot off and wait for several updates and turn it back on. You will see it when the bot is catching the updates.

sent := send(bot, u, res, keyboard, r.Replace(sql.DefaultWelcome), !welcPrefs.DelJoined)

sql.SetCleanWelcome(strconv.Itoa(chat.Id), sent.MessageId)

sent is nil due to the bot did not send the welcome, and when inserting the new msg id it leads to nil object