Custom this BotCommand #48

Merged
modulatingforce merged 12 commits from say-this-guy into master 2024-04-09 15:49:58 -04:00
Showing only changes of commit 55aeaa7fc1 - Show all commits

View file

@ -4,6 +4,7 @@ use crate::core::botlog;
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager};
use crate::core::identity::UserRole::*;
use rand::Rng;
use twitch_irc::message::ReplyToMessage;
use std::sync::Arc;
use tokio::time::{sleep, Duration};
const OF_CMD_CHANNEL:Channel = Channel(String::new());
@ -34,7 +35,11 @@ async fn tsg(params: ExecBodyParams) {
botlock
.botmgrs
.chat
modulatingforce marked this conversation as resolved
Review

We're getting an error here in ci/cd

error[E0061]: this method takes 4 arguments but 3 arguments were supplied
   --> src\custom\thisguy.rs:37:10
    |
37  |         .say_in_reply_to(&params.msg, a, params.clone())
    |          ^^^^^^^^^^^^^^^ -----------     -------------- an argument of type `std::string::String` is missing
    |                          |
    |                          expected `Channel`, found `&PrivmsgMessage`
    |
note: method defined here
   --> src\core\chat.rs:415:18
    |
415 |     pub async fn say_in_reply_to(
    |                  ^^^^^^^^^^^^^^^
416 |         &self,
417 |         destination_channel : Channel ,
    |         -----------------------------
418 |         reply_message_id : String ,
    |         -------------------------
419 |         outmsg: String ,
    |         --------------
420 |         params : ExecBodyParams)
    |         -----------------------
help: provide the argument
    |
37  |         .say_in_reply_to(/* core::botinstance::Channel */, a, /* std::string::String */, params.clone())
    |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Recommend this be adjusted to

.say_in_reply_to(&params.msg.channel_login(), &params.msg.message_id(),a, params.clone())
We're getting an error here in ci/cd ``` error[E0061]: this method takes 4 arguments but 3 arguments were supplied --> src\custom\thisguy.rs:37:10 | 37 | .say_in_reply_to(&params.msg, a, params.clone()) | ^^^^^^^^^^^^^^^ ----------- -------------- an argument of type `std::string::String` is missing | | | expected `Channel`, found `&PrivmsgMessage` | note: method defined here --> src\core\chat.rs:415:18 | 415 | pub async fn say_in_reply_to( | ^^^^^^^^^^^^^^^ 416 | &self, 417 | destination_channel : Channel , | ----------------------------- 418 | reply_message_id : String , | ------------------------- 419 | outmsg: String , | -------------- 420 | params : ExecBodyParams) | ----------------------- help: provide the argument | 37 | .say_in_reply_to(/* core::botinstance::Channel */, a, /* std::string::String */, params.clone()) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- Recommend this be adjusted to ```rust .say_in_reply_to(&params.msg.channel_login(), &params.msg.message_id(),a, params.clone()) ```
.say_in_reply_to(&params.msg, a, params.clone())
.say_in_reply(
Channel(params.clone().msg.channel_login().to_string()),
a,
params.clone()
)
.await;
sleep(Duration::from_secs_f64(0.5)).await;
}