summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig
index f1eee79..4a600e0 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -320,11 +320,16 @@ fn onTextMessage(bot: *Bot, msg: types.Message, text: []const u8) !void {
320 }); 320 });
321 } 321 }
322 } else if (std.ascii.eqlIgnoreCase(text, "dio cane")) { 322 } else if (std.ascii.eqlIgnoreCase(text, "dio cane")) {
323 const reply_to = if (msg.reply_to_message) |r|
324 r.message_id
325 else
326 msg.message_id;
327
323 try bot.sendMessage_(.{ 328 try bot.sendMessage_(.{
324 .chat_id = msg.chat.id, 329 .chat_id = msg.chat.id,
325 .text = "porco dio", 330 .text = "porco dio",
326 .reply_parameters = .{ 331 .reply_parameters = .{
327 .message_id = msg.message_id, 332 .message_id = reply_to,
328 .chat_id = msg.chat.id, 333 .chat_id = msg.chat.id,
329 }, 334 },
330 }); 335 });
@@ -357,11 +362,16 @@ fn onTextMessage(bot: *Bot, msg: types.Message, text: []const u8) !void {
357 }, 362 },
358 }); 363 });
359 } else if (std.ascii.eqlIgnoreCase(text, "porco dio")) { 364 } else if (std.ascii.eqlIgnoreCase(text, "porco dio")) {
365 const reply_to = if (msg.reply_to_message) |r|
366 r.message_id
367 else
368 msg.message_id;
369
360 try bot.sendMessage_(.{ 370 try bot.sendMessage_(.{
361 .chat_id = msg.chat.id, 371 .chat_id = msg.chat.id,
362 .text = "dio cane", 372 .text = "dio cane",
363 .reply_parameters = .{ 373 .reply_parameters = .{
364 .message_id = msg.message_id, 374 .message_id = reply_to,
365 .chat_id = msg.chat.id, 375 .chat_id = msg.chat.id,
366 }, 376 },
367 }); 377 });