Chat say functionality #41

Merged
modulatingforce merged 14 commits from chat-say into main 2024-03-24 00:00:48 -04:00
2 changed files with 33 additions and 0 deletions
Showing only changes of commit 7e59b8b251 - Show all commits

View file

@ -76,6 +76,17 @@ impl Chat {
// },
};
if self.client.get_channel_status(channel_login.clone()).await == (false,false) {
// in the case where the provided channel isn't something we're known to be connected to
botlog::warn(
&format!("A message attempted to send for a Non-Joined Channel : {}",channel_login.clone()),
Some("Chat > send_botmsg".to_string()),
None,
);
return ;
}
let rl = Arc::clone(&self.ratelimiters);
let mut rllock = rl.lock().await;

View file

@ -81,6 +81,7 @@ async fn sayout(bot: BotAR, msg: PrivmsgMessage) {
match argrslt {
Some((trgchnl,outmsg)) => {
@ -93,6 +94,27 @@ async fn sayout(bot: BotAR, msg: PrivmsgMessage) {
let botlock = bot.read().await;
// [x] Validate first if trgchnl exists
if botlock.botmgrs.chat.client.get_channel_status(trgchnl.to_string().clone()).await == (false,false) {
// in the case where the provided channel isn't something we're known to be connected to
// botlog::warn(
// &format!("A message attempted to send for a Non-Joined Channel : {}",channel_login.clone()),
// Some("Chat > send_botmsg".to_string()),
// None,
// );
// return ;
botlock
.botmgrs
.chat
.say_in_reply_to(&msg, format!("Cannot join channel : {}",trgchnl.to_string()))
.await;
}
// uses chat.say_in_reply_to() for the bot controls for messages
botlock
.botmgrs