diff --git a/src/bot.zig b/src/bot.zig index ee3ab49..26d1ea6 100644 --- a/src/bot.zig +++ b/src/bot.zig @@ -216,7 +216,7 @@ test "hear and deinit has no leaks" { defer bot.deinit(); const testMessage = try newTestMessage(allocator, "test"); - bot.hear(testMessage); + bot.store(testMessage); try std.testing.expectEqual(0, bot.backlog.top); } @@ -228,7 +228,7 @@ test "a few hears and deinit has no leaks" { for (0..2) |_| { const testMessage = try newTestMessage(std.testing.allocator, "test"); - bot.hear(testMessage); + bot.store(testMessage); } try std.testing.expectEqual(1, bot.backlog.top); @@ -240,7 +240,7 @@ test "hear wraps" { for (0..1025) |_| { const testMessage = try newTestMessage(std.testing.allocator, "test"); - bot.hear(testMessage); + bot.store(testMessage); } try std.testing.expectEqual(0, bot.backlog.top); @@ -266,7 +266,7 @@ test "execute substitution" { // hear original message with typo const msg = try newTestMessage(allocator, "What"); - bot.hear(msg); + bot.store(msg); // execute substitution const cmd = UserCommand.init_substitute("jassob", "What", "what", false); @@ -287,7 +287,7 @@ test "execute substitution with no matching needle" { // hear original message const msg = try newTestMessage(std.testing.allocator, "original"); - bot.hear(msg); + bot.store(msg); // execute substitution const cmd = UserCommand.init_substitute("jassob", "something else", "weird", false); @@ -300,7 +300,7 @@ test "recursive substitutions does not cause issues" { // hear original message const msg = try newTestMessage(std.testing.allocator, "original"); - bot.hear(msg); + bot.store(msg); // execute substitution const cmd = UserCommand.init_substitute("jassob", "original", "something else", false); diff --git a/src/main.zig b/src/main.zig index 2ef1980..43f2880 100644 --- a/src/main.zig +++ b/src/main.zig @@ -85,7 +85,7 @@ pub const BotAdapter = struct { msg.targets, msg.text, ) catch |err| return report_error(err); - self.bot.hear(bot_msg); + self.bot.store(bot_msg); return null; }, .JOIN => |msg| {