foreach ($query1->rows as $image) {
if (is_file(DIR_IMAGE . $image['upc'])) {
$images = array(
'order_product_image_id' => $image['order_product_image_id'],
'image' => $this->model_tool_image->resize($image['upc'], 433, 433),
'image2' => $this->model_tool_image->resize($image['foto'], 433, 433)
);
}
// или так (скорее всего вам это и нужно):
if (is_file(DIR_IMAGE . $image['foto'])) {
$images2 = array(
'order_product_image_id' => $image['order_product_image_id'],
'image2' => $this->model_tool_image->resize($image['foto'], 433, 433)
);
} func handler(m *tb.Message) error {
bot.Send(m.Sender, "It is help")
}
bot, _ := tb.NewBot(tb.Settings{
Token: "bot",
Poller: &tb.LongPoller{Timeout: 10 * time.Second},
})
bot.Handle("/help", handler)func handler() func(*tb.Message) error {
return func(m *tb.Message) error {
bot.Send(m.Sender, "It is help")
}
}
bot, _ := tb.NewBot(tb.Settings{
Token: "bot",
Poller: &tb.LongPoller{Timeout: 10 * time.Second},
})
bot.Handle("/help", handler()) // Graceful shutdown, пишем это перед последней ждущей функцией
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
go func() {
<-c
// здесь логика завершения и очистки ресурсов, например:
db.Close()
app.Exit()
}()