diff options
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig index 4bd15fe..203f4ab 100644 --- a/src/main.zig +++ b/src/main.zig | |||
| @@ -324,6 +324,23 @@ fn onTextCommand(bot: *Bot, msg: types.Message, text: []const u8, cmd: []const u | |||
| 324 | .chat_id = msg.chat.id, | 324 | .chat_id = msg.chat.id, |
| 325 | }, | 325 | }, |
| 326 | }); | 326 | }); |
| 327 | } else if (std.mem.eql(u8, simple_cmd, "msginfo")) { | ||
| 328 | if (msg.reply_to_message) |replied| { | ||
| 329 | const str_data = try std.json.stringifyAlloc(bot.allocator, replied.*, .{ | ||
| 330 | .whitespace = .indent_2, | ||
| 331 | .emit_null_optional_fields = false, | ||
| 332 | }); | ||
| 333 | defer bot.allocator.free(str_data); | ||
| 334 | |||
| 335 | try bot.sendMessage_(.{ | ||
| 336 | .chat_id = msg.chat.id, | ||
| 337 | .text = str_data, | ||
| 338 | .reply_parameters = .{ | ||
| 339 | .message_id = msg.message_id, | ||
| 340 | .chat_id = msg.chat.id, | ||
| 341 | }, | ||
| 342 | }); | ||
| 343 | } | ||
| 327 | } else if (std.mem.eql(u8, simple_cmd, "ping")) { | 344 | } else if (std.mem.eql(u8, simple_cmd, "ping")) { |
| 328 | var timer = try std.time.Timer.start(); | 345 | var timer = try std.time.Timer.start(); |
| 329 | 346 | ||