macro_rules! topics {
(
$(use HelpTopic $topic:ident for $desc:literal;)+
) => {
pub mod topics {
$(
#[doc = concat!(
"# ",
$desc,
"\n\nTo access this help from Lua, call `help '",
stringify!($topic),
"'`.\n\n```txt\n",
include_str!(
concat!("help_system/topics/", stringify!($topic), ".txt")
))]
pub mod $topic {
use crate::userscript_api::help_system::HelpTopic;
#[doc = "Userscript API help topic definition."]
pub struct Topic;
impl HelpTopic for Topic {
fn name(&self) -> &'static str {
stringify!($topic)
}
fn short_description(&self) -> &'static str {
$desc
}
fn content(&self) -> &'static str {
include_str!(
concat!("help_system/topics/", stringify!($topic), ".txt")
)
}
}
}
)+
}
};
}
pub(crate) use topics;
macro_rules! impl_ping {
($($actor:ident),+) => {
use kameo::message::{Context, Message};
$(
impl Message<Ping> for $actor {
type Reply = ();
async fn handle(&mut self, _: Ping, _: Context<'_, Self, Self::Reply>) -> Self::Reply {}
}
)+
};
}
pub(crate) use impl_ping;