diff options
| author | Max Audron <audron@cocaine.farm> | 2021-06-05 15:07:33 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2021-06-05 15:10:53 +0200 |
| commit | 26a16d73ec96b0a111fc6b5388d2ab8cc52ae600 (patch) | |
| tree | 9c857302f2eddb0bbb4409254f86f63a93358c6a /src/hooks/intensify.rs | |
| parent | add privmsg macro (diff) | |
add intensify
Diffstat (limited to 'src/hooks/intensify.rs')
| -rw-r--r-- | src/hooks/intensify.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/hooks/intensify.rs b/src/hooks/intensify.rs new file mode 100644 index 0000000..87a4edf --- /dev/null +++ b/src/hooks/intensify.rs @@ -0,0 +1,17 @@ +use anyhow::Result; +use irc::client::prelude::*; +use macros::privmsg; + +pub fn intensify(bot: &crate::Bot, msg: Message) -> Result<()> { + privmsg!(msg, { + let mut chars = text.chars(); + chars.next(); + chars.next_back(); + let content = chars.as_str(); + + bot.send_privmsg( + msg.response_target().unwrap(), + format!("\x02\x0304[\x1d{} INTENSIFIES\x1d]\x03\x0F", content.to_uppercase()).as_str(), + )?; + }) +} |
