mirror of
https://github.com/moritzsternemann/QtTelegramBot.git
synced 2025-07-30 11:27:14 +02:00
Fixed example not working (at runtime)
This commit is contained in:
@ -11,7 +11,7 @@ void newMessage(Telegram::Message message)
|
|||||||
qDebug() << "new message:" << message;
|
qDebug() << "new message:" << message;
|
||||||
|
|
||||||
if (bot && message.type == Telegram::Message::TextType) {
|
if (bot && message.type == Telegram::Message::TextType) {
|
||||||
bot->sendMessage(message.from.id, message.string);
|
bot->sendMessage((qint32)message.from.id, message.string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
|
|
||||||
bot = new Telegram::Bot(TOKEN, false, 500, 4);
|
bot = new Telegram::Bot(TOKEN, true, 500, 4);
|
||||||
QObject::connect(bot, &Telegram::Bot::message, &newMessage);
|
QObject::connect(bot, &Telegram::Bot::message, &newMessage);
|
||||||
qDebug() << "Started Telegram Bot";
|
qDebug() << "Started Telegram Bot";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user