From 95f292c8cdacfae321a842939b2c2abb869dfabb Mon Sep 17 00:00:00 2001 From: Yash Karandikar Date: Mon, 13 Mar 2023 14:13:55 -0500 Subject: [PATCH] Relay IRC kicks --- src/irc_discord.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/irc_discord.rs b/src/irc_discord.rs index d19def2..42e8446 100644 --- a/src/irc_discord.rs +++ b/src/irc_discord.rs @@ -225,6 +225,15 @@ pub async fn irc_loop( let topic = unwrap_or_continue!(topic.as_ref()); let channel_id = ChannelId::from(*unwrap_or_continue!(mapping.get(channel))); channel_id.edit(&http, |c| c.topic(topic)).await?; + } else if let Command::KICK(ref channel, ref user, ref reason) = orig_message.command { + let channel_id = ChannelId::from(*unwrap_or_continue!(mapping.get(channel))); + let reason = reason.as_deref().unwrap_or("None"); + + send.send(QueuedMessage::Raw { + channel_id, + http: http.clone(), + message: format!("*{}* has kicked *{}* ({})", nickname, user, reason), + })?; } } Ok(())