say chnl must be valid

This commit is contained in:
ModulatingForce 2024-03-23 18:33:33 -04:00
commit 7e59b8b251
2 changed files with 33 additions and 0 deletions
src/custom/experimental

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