parent
d372d0dc79
commit
e4a44894d7
4 changed files with 21 additions and 42 deletions
src/custom/experimental
|
@ -65,41 +65,33 @@ async fn sayout(bot: BotAR, msg: PrivmsgMessage) {
|
|||
<target channel> <message>
|
||||
*/
|
||||
|
||||
|
||||
let reply_parent = if let Some(replyout) = msg.source.tags.0.get("reply-parent-msg-body") {
|
||||
if let Some(replymsg) = replyout {
|
||||
// println!("Detected Reply : {}",replyid);
|
||||
Some(replymsg)
|
||||
let reply_parent = if let Some(Some(reply)) = msg.source.tags.0.get("reply-parent-msg-body") {
|
||||
Some(reply)
|
||||
} else { None }
|
||||
} else { None }
|
||||
;
|
||||
|
||||
let reply_parent_usr = if let Some(replyout) = msg.source.tags.0.get("reply-thread-parent-user-login") {
|
||||
if let Some(replymsgusr) = replyout {
|
||||
// println!("Detected Reply : {}",replyid);
|
||||
Some(replymsgusr)
|
||||
|
||||
let reply_parent_usr = if let Some(Some(reply)) = msg.source.tags.0.get("reply-thread-parent-user-login") {
|
||||
Some(reply)
|
||||
} else { None }
|
||||
} else { None }
|
||||
;
|
||||
|
||||
// [x] Unwraps arguments from message
|
||||
|
||||
|
||||
let argrslt =
|
||||
if let Some((_,str1)) = msg.message_text.split_once(" ") {
|
||||
if let Some((_,str1)) = msg.message_text.split_once(' ') {
|
||||
if reply_parent.is_none() {
|
||||
if let Some((channelstr,msgstr)) = str1.split_once(" ") {
|
||||
if let Some((channelstr,msgstr)) = str1.split_once(' ') {
|
||||
Some((channelstr,msgstr))
|
||||
}
|
||||
else { None }
|
||||
} else {
|
||||
if let Some((_,str2)) = str1.split_once(" ") {
|
||||
if let Some((channelstr,msgstr)) = str2.split_once(" ") {
|
||||
Some((channelstr,msgstr))
|
||||
}
|
||||
else { None }
|
||||
} else if let Some((_,str2)) = str1.split_once(' ') {
|
||||
if let Some((channelstr,msgstr)) = str2.split_once(' ') {
|
||||
Some((channelstr,msgstr))
|
||||
}
|
||||
else { None }
|
||||
}
|
||||
} else { None }
|
||||
}
|
||||
else { None };
|
||||
|
||||
|
@ -136,7 +128,7 @@ async fn sayout(bot: BotAR, msg: PrivmsgMessage) {
|
|||
botlock
|
||||
.botmgrs
|
||||
.chat
|
||||
.say_in_reply_to(&msg, format!("Not a Joined Channel : {}",trgchnl.to_string()))
|
||||
.say_in_reply_to(&msg, format!("Not a Joined Channel : {}",trgchnl))
|
||||
.await;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue