Giter Site home page Giter Site logo

rust_proc_qq's Issues

无法扫码登录

扫码时提示该APP尚未开通扫描二维码登录的权限。

ClientBuilder::new()
        .priority_session("session.token") // 默认使用session.token登录
        .device(JsonFile("device.json".to_owned())) // 设备默认值
        .authentication(Authentication::QRCode) // 若不成功则使用二维码登录
        .modules(vec![module::dnd::module(), module::dice::module()]) // 您可以注册多个模块
        .build()
        .await
        .unwrap()
        .start()
        .await
        .unwrap()
        .unwrap();

使用账号密码登录无法通过设备锁。关闭设备锁账号疑似被风控,QQ群信息发送长度受限。

教学视频,文档

第一次尝试写qq机器人,请问从哪里开始学可以入门呢?(好像这个提issue不太合适,如有冒犯请删除)
: )

无法登录

使用二维码扫码登录,扫码后提示 当前环境存在风险,为保障你的账号安全,暂时无法登录, 换了三个账号都是同样情况

后换成使用密码登录,但是弹出滑块验证滑动验证完成后,滑块验证页面白屏无任何反应,打开控制台显示两个错误

image

这种情况该如何处理呢

桌面弹窗滑块

# 滑块助手
.show_slider(Some(ShowSlider:AndroidHelper)) // 默认
# 桌面弹窗
.show_slider(Some(ShowSlider:PopWindow))

参考showQR

桌面弹窗参考 https://github.com/Cherrs/lailai 实现, 可能安卓会编译不通过, 那样的话使用#[cfg]。

anyhow报错问题解决办法

Cargo.toml

anyhow = "1.0.59"

Cargo.lock

[[package]]
name = "anyhow"
version = "1.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c91f1f46651137be86f3a2b9a8359f9ab421d04d941c62b5982e1ca21113adf9"

module添加方式

能否为Module添加一种父子模块的注册方式
比如一个父模块如下

lazy_static! {
    static ref MODULES: Arc<Vec<Module>> = Arc::new(vec![]);
}

pub fn all_module() -> Arc<Vec<Module>> {
    MODULES.clone()
}

在modules的目录下有一个子目录的模块

lazy_static! {
    static ref OSU_MODULES: Arc<Vec<Module>> = Arc::new(vec![]);
}

pub fn osu_module() -> Arc<Vec<Module>> {
    OSU_MODULES.clone()
}

能否添加一种方法(比如迭代器)将子模块与父模块进行合并, 比如

pub fn all_module() -> Arc<Vec<Module>> {
    let mut modules = MODULES.clone();
    modules.extend(osu::osu_module().clone().into_iter());
    modules
}

联系方式

有联系方式吗请问,想用这个做个软件,可以交流下吗

恢复会话失败回调

能否提供一个重新登陆失败的回调接口,方便失败之后做一些操作,例如重启自身来登录。

使用正则或其他对event匹配

参考 SimpleBot

// 场景一
// 解析命令
#[event(command("hello {name}"))]
async fn hello(event: &MessageEvent, name: Option<String>) -> anyhow::Result<bool> {
    if name.is_none() {
        return Ok(false);
    }
    event.send_message_to_source(format!("hello {}", name.unwrap()).parse_message_chain()).await.unwrap();
    Ok(true)
}

// 场景二
// 解析且必须通过过滤器,例如游戏,判断有没有redis状态机
#[event(all(command("hello {name}", filter = "i_am_filter")))]
async fn hello(event: &MessageEvent) -> anyhow::Result<bool> {
    if name.is_none() {
        return Ok(false);
    }
    event.send_message_to_source(format!("hello {}", name.unwrap()).parse_message_chain()).await.unwrap();
    Ok(true)
}

async fn filter(event: &MessageEvent) -> anyhow::Result<bool> {
    if name.is_none() {
        return Ok(false);
    }
    event.send_message_to_source(format!("hello {}", name.unwrap()).parse_message_chain()).await.unwrap();
    Ok(true)
}

// 场景3 消息必须符合正则表达式
#[event(regexp("hello {name}"))]

[功能] 定时任务支持

大佬看看这个可行吗 commit

/// 每1分钟获取一次 bot uin
#[scheduler_job(cron = "0 0/1 * * * ?")]
async fn handle_scheduler(c:Arc<Client>) {
    let bot_uin = c.bot_uin().await;
    println!("{}", bot_uin);
}

/// scheduler
pub fn scheduler() -> SchedulerJob {
    scheduler!(
        "hello_jobs",
        handle_scheduler
    )
}

如果可以的话我提一个pr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.