From d22f2b74d8931a32da0ed970bedcb4e49f4934f7 Mon Sep 17 00:00:00 2001 From: ashelyn ghost Date: Mon, 8 Jul 2024 21:30:34 -0600 Subject: Basic proxying --- src/listener.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/listener.rs') diff --git a/src/listener.rs b/src/listener.rs index 1db480f..9d0e062 100644 --- a/src/listener.rs +++ b/src/listener.rs @@ -1,5 +1,5 @@ use tokio::sync::mpsc::Sender; -use twilight_model::{id::{Id, marker::{MessageMarker, UserMarker}}, user::User}; +use twilight_model::{channel::ChannelMention, id::{Id, marker::{ChannelMarker, MessageMarker, UserMarker}}, user::User}; use twilight_gateway::{error::ReceiveMessageError, Intents, Shard, ShardId}; use twilight_model::util::Timestamp; @@ -17,8 +17,6 @@ impl Listener { } pub async fn start_listening(&mut self, channel : Sender) { - println!("Starting client with token: {}", self.config.discord_token); - let intents = Intents::GUILD_MEMBERS | Intents::GUILD_PRESENCES | Intents::GUILD_MESSAGES | Intents::MESSAGE_CONTENT; let mut shard = Shard::new(ShardId::ONE, self.config.discord_token.clone(), intents); @@ -39,6 +37,7 @@ impl Listener { if let Err(_) = channel.send(ClientEvent::Message { event_time: message.timestamp, message_id: message.id, + channel_id: message.channel_id, author: message.author.clone(), content: message.content.clone() }).await { @@ -61,6 +60,7 @@ impl Listener { if let Err(_) = channel.send(ClientEvent::Message { event_time: message.edited_timestamp.unwrap(), message_id: message.id, + channel_id: message.channel_id, author: message.author.unwrap(), content: message.content.unwrap() }).await { @@ -92,6 +92,7 @@ pub enum ClientEvent { Message { event_time: Timestamp, message_id: Id, + channel_id: Id, author: User, content: String, }, -- cgit 1.4.1