From ec104a719f46d6812661c29355e7a9fea8418b49 Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Sun, 6 Oct 2024 15:25:01 -0600 Subject: Actually carries out !edit and !s commands --- src/system/bot/client.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/system/bot/client.rs') diff --git a/src/system/bot/client.rs b/src/system/bot/client.rs index 61d7515..4d4f7bb 100644 --- a/src/system/bot/client.rs +++ b/src/system/bot/client.rs @@ -90,6 +90,13 @@ impl Client { return Ok(()) } + pub async fn edit_message(&self, channel_id: ChannelId, message_id: MessageId, new_content: String) -> Result { + Ok(self.client.lock().await.update_message(channel_id, message_id) + .content(Some(new_content.as_str())).expect("Invalid message contents") + .await.expect("Could not update message") + .model().await.unwrap()) + } + pub async fn duplicate_message(&self, message: &TwiMessage, content: &str) -> Result { let client = self.client.lock().await; -- cgit 1.4.1