This commit is contained in:
yuzu 2025-05-15 15:13:50 -05:00
parent b8c42bb22c
commit 237ba0f434
4 changed files with 7 additions and 8 deletions

View File

@ -25,8 +25,8 @@
// internet connectivity. // internet connectivity.
.dependencies = .{ .dependencies = .{
.zlib = .{ .zlib = .{
.url = "https://github.com/yuzudev/zig-zlib/archive/refs/heads/main.zip", .url = "https://git.yuzucchii.xyz/yuzucchii/zlib/archive/master.tar.gz",
.hash = "zlib-0.1.0-AAAAAKm6QADNBB6NBPHanW9G0EOPTmgJsRO6NFT__arp", .hash = "zlib-0.1.0-AAAAALW6QABbti7dQfKuK0IQb-xdcp3SI8zdTvs5ouUD",
}, },
.websocket = .{ .url = "https://github.com/karlseguin/websocket.zig/archive/refs/heads/master.zip", .hash = "websocket-0.1.0-ZPISdYBIAwB1yO6AFDHRHLaZSmpdh4Bz4dCmaQUqNNWh" }, .websocket = .{ .url = "https://github.com/karlseguin/websocket.zig/archive/refs/heads/master.zip", .hash = "websocket-0.1.0-ZPISdYBIAwB1yO6AFDHRHLaZSmpdh4Bz4dCmaQUqNNWh" },
}, },

0
src/session.zig Normal file
View File

View File

@ -858,12 +858,10 @@ pub fn Shard(comptime Table: TableTemplate) type {
}; };
// default handler for whoever wants it // default handler for whoever wants it
//if (self.handler.any) |anyEvent| if (self.handler.any) |anyEvent|
//try anyEvent(self, payload); try anyEvent(self, payload);
} }
pub const RequestFailedError = MakeRequestError || error{FailedRequest} || json.ParseError(json.Scanner);
// start http methods // start http methods
/// Retrieves the messages in a channel. /// Retrieves the messages in a channel.
@ -2905,10 +2903,12 @@ pub fn Shard(comptime Table: TableTemplate) type {
return req.delete(path); return req.delete(path);
} }
inline fn logif(self: *Self, comptime format: []const u8, args: anytype) void {
pub fn logif(self: *Self, comptime format: []const u8, args: anytype) void {
internalLogif(self.log, format, args); internalLogif(self.log, format, args);
} }
pub const RequestFailedError = MakeRequestError || error{FailedRequest} || json.ParseError(json.Scanner);
}; };
} }

View File

@ -29,7 +29,6 @@ fn ready(_: *anyopaque, payload: Discord.Ready) !void {
fn message_create(shard_ptr: *anyopaque, message: Discord.Message) !void { fn message_create(shard_ptr: *anyopaque, message: Discord.Message) !void {
// set custom cache // set custom cache
const session: *Shard(Cache) = @ptrCast(@alignCast(shard_ptr)); const session: *Shard(Cache) = @ptrCast(@alignCast(shard_ptr));
if (message.content != null and std.ascii.eqlIgnoreCase(message.content.?, "!hi")) { if (message.content != null and std.ascii.eqlIgnoreCase(message.content.?, "!hi")) {
var result = try session.sendMessage(message.channel_id, .{ .content = "hi :)" }); var result = try session.sendMessage(message.channel_id, .{ .content = "hi :)" });
defer result.deinit(); defer result.deinit();