V version: last
OS: manjaro
What did you do?
import vpervenditti.vgram
bot := vgram.new_bot('TELEGRAM TOKEN', true) // <- set true to see debug log
mut updates := []vgram.Update{}
mut last_offset := 0
for {
updates = bot.get_updates(vgram.NewGetUpdates{offset: last_offset, limit: 100})
for update in updates {
if last_offset < update.update_id {
last_offset = update.update_id
match update.message.text {
'/start' => bot.send_message(vgram.NewSendMessage{
chat_id: update.message.from.id.str(),
text: 'Hi man'
})
}
}
}
}
What did you expect to see?
A working chatbot
What did you see instead?
V panic: option size too big: 1520 (max is 255), this is a temporary limit
When generics are ready option will accept any size of data. For now the limit is used for every option, even if you only need 1 byte. Increasing that limit ATM makes all code using option more inefficient.
Could we workaround this problem? A build option to increase the option limit for v itself, or a hack to make the option smaller?
@medvednikov what's the status on this? This is a serious limitation especially when sending http.Requests and decoding large JSON payloads. Is there a workaround for now?
Fixed.
Most helpful comment
@medvednikov what's the status on this? This is a serious limitation especially when sending http.Requests and decoding large JSON payloads. Is there a workaround for now?