I know this is a really dumb question, sorry, as I'm still learning Zig so I'm having a hard time learning from the code itself.
I'm using the sample IRC bot code, and one of the first things I wanted to do was enhance the !help text. Most output is multiline, and the code doesn't automatically handle linebreaks like \r\n in the text, so I tried doing something like:
fn help(prefix: ?zircon.Prefix, targets: []const u8) ?zircon.Message {
_ = zircon.Message{
.PRIVMSG = .{
.targets = if (prefix) |p| p.nick orelse targets else targets,
.text = "Commands are:",
},
};
return = zircon.Message{
.PRIVMSG = .{
.targets = if (prefix) |p| p.nick orelse targets else targets,
.text = "!help (This text)",
},
};
}
But sadly, only the last one ever makes it (the "!help (This text)" one). What stupid thing am I missing?
I know this is a really dumb question, sorry, as I'm still learning Zig so I'm having a hard time learning from the code itself.
I'm using the sample IRC bot code, and one of the first things I wanted to do was enhance the !help text. Most output is multiline, and the code doesn't automatically handle linebreaks like \r\n in the text, so I tried doing something like:
fn help(prefix: ?zircon.Prefix, targets: []const u8) ?zircon.Message {
_ = zircon.Message{
.PRIVMSG = .{
.targets = if (prefix) |p| p.nick orelse targets else targets,
.text = "Commands are:",
},
};
return = zircon.Message{
.PRIVMSG = .{
.targets = if (prefix) |p| p.nick orelse targets else targets,
.text = "!help (This text)",
},
};
}
But sadly, only the last one ever makes it (the "!help (This text)" one). What stupid thing am I missing?