niuhuan / rust_proc_qq Goto Github PK
View Code? Open in Web Editor NEW[RUST] 模块化QQ机器人框架 (Based RICQ)
License: Mozilla Public License 2.0
[RUST] 模块化QQ机器人框架 (Based RICQ)
License: Mozilla Public License 2.0
应该弄个trait,个性化处理ticket
扫码时提示该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不太合适,如有冒犯请删除)
: )
现在仅有使用桌面打开二维码的功能
.show_rq(Some(ShowQR::OpenBySystem))
# 打印到控制台
.show_rq(Some(ShowQR::PrintToConsole))
需要使用 https://github.com/timvisee/qr2term-rs 实现
打印到控制台设置为默认
# 滑块助手
.show_slider(Some(ShowSlider:AndroidHelper)) // 默认
# 桌面弹窗
.show_slider(Some(ShowSlider:PopWindow))
参考showQR
桌面弹窗参考 https://github.com/Cherrs/lailai 实现, 可能安卓会编译不通过, 那样的话使用#[cfg]。
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添加一种父子模块的注册方式
比如一个父模块如下
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
}
有联系方式吗请问,想用这个做个软件,可以交流下吗
能否提供一个重新登陆失败的回调接口,方便失败之后做一些操作,例如重启自身来登录。
参考 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
命令类型不匹配或者前缀部分匹配时推测出用户想要输入的命令并给出提示
让设备锁、短信解锁变得可配置
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.