diff options
| author | 2025-07-30 01:51:18 +0300 | |
|---|---|---|
| committer | 2025-07-30 01:51:18 +0300 | |
| commit | 9f02b76f9b6dd64cb805870dae1d52509af70488 (patch) | |
| tree | cd3c43d3c9ab102ebc80f1181b19610468845c69 /src | |
| parent | Add Italian swearing (diff) | |
| download | ukkobot-9f02b76f9b6dd64cb805870dae1d52509af70488.tar.gz ukkobot-9f02b76f9b6dd64cb805870dae1d52509af70488.tar.xz ukkobot-9f02b76f9b6dd64cb805870dae1d52509af70488.zip | |
Make the Italian swearing reply the replied-to mesage
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 14 |
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 | }); |