From 309899168a086de88acf97fd6683387a7af7078c Mon Sep 17 00:00:00 2001 From: Max Audron Date: Fri, 22 Oct 2021 19:08:59 +0200 Subject: write tons of documentation and reorganize some modules --- src/hooks/mod.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/hooks/mod.rs') diff --git a/src/hooks/mod.rs b/src/hooks/mod.rs index 86d5697..822f839 100644 --- a/src/hooks/mod.rs +++ b/src/hooks/mod.rs @@ -1,17 +1,22 @@ -extern crate rand; +//! The bots hooks, commands and matchers. For explanation of different types see [crate::catinator] +//! +//! # Implementing hooks use anyhow::Result; use irc::client::prelude::*; -pub mod intensify; -pub mod pet; +mod intensify; +mod pet; +mod shifty_eyes; + +pub use intensify::*; +pub use pet::*; +pub use shifty_eyes::*; + pub mod sed; -pub mod shifty_eyes; pub mod wolfram_alpha; -pub use intensify::intensify; -pub use shifty_eyes::shifty_eyes; - +/// Replies with some information about the bot pub fn about(bot: &crate::Bot, msg: Message) -> Result<()> { bot.send_privmsg( msg.response_target().unwrap(), @@ -26,6 +31,7 @@ pub fn about(bot: &crate::Bot, msg: Message) -> Result<()> { Ok(()) } +/// Listen to AUTHENTICATE messages and perform SASL authentication pub fn sasl(bot: &crate::Bot, msg: Message) -> Result<()> { match msg.command { Command::AUTHENTICATE(text) => { -- cgit v1.2.3