diff options
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.zig b/src/main.zig index 2e33cfc..b164284 100644 --- a/src/main.zig +++ b/src/main.zig | |||
| @@ -199,10 +199,10 @@ fn onTextMessage(bot: *Bot, msg: types.Message, text: []const u8) !void { | |||
| 199 | }, | 199 | }, |
| 200 | }); | 200 | }); |
| 201 | } else if (std.ascii.startsWithIgnoreCase(text, "big ")) { | 201 | } else if (std.ascii.startsWithIgnoreCase(text, "big ")) { |
| 202 | const trimmed = try utils.trim(text[4..]); | 202 | const the_text = text[4..]; |
| 203 | const cd = try utils.getCD(); | 203 | if (!try utils.isTgWhitespaceStr(the_text)) { |
| 204 | if (trimmed.len > 0) { | 204 | const cd = try utils.getCD(); |
| 205 | const uppercased = try cd.toUpperStr(bot.allocator, trimmed); | 205 | const uppercased = try cd.toUpperStr(bot.allocator, the_text); |
| 206 | defer bot.allocator.free(uppercased); | 206 | defer bot.allocator.free(uppercased); |
| 207 | 207 | ||
| 208 | var output = ArrayList(u8).init(bot.allocator); | 208 | var output = ArrayList(u8).init(bot.allocator); |
| @@ -251,11 +251,11 @@ fn onTextMessage(bot: *Bot, msg: types.Message, text: []const u8) !void { | |||
| 251 | }, | 251 | }, |
| 252 | }); | 252 | }); |
| 253 | } else if (std.ascii.startsWithIgnoreCase(text, "say ")) { | 253 | } else if (std.ascii.startsWithIgnoreCase(text, "say ")) { |
| 254 | const trimmed = try utils.trim(text[4..]); | 254 | const the_text = text[4..]; |
| 255 | if (trimmed.len > 0) { | 255 | if (!try utils.isTgWhitespaceStr(the_text)) { |
| 256 | try bot.sendMessage_(.{ | 256 | try bot.sendMessage_(.{ |
| 257 | .chat_id = msg.chat.id, | 257 | .chat_id = msg.chat.id, |
| 258 | .text = trimmed, | 258 | .text = the_text, |
| 259 | .reply_parameters = .{ | 259 | .reply_parameters = .{ |
| 260 | .message_id = msg.message_id, | 260 | .message_id = msg.message_id, |
| 261 | .chat_id = msg.chat.id, | 261 | .chat_id = msg.chat.id, |