We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
代码如下,不知道为什么会报这个错
const { Bot, Message } = require("mirai-js"); const print = console.log; const bot = new Bot(); // 连接到一个 mirai-api-http 服务 async function conn() { await bot.open({ baseUrl: "http://0.0.0.0:9999", verifyKey: "INITKEYHX5of1Nh", // 要绑定的 qq,须确保该用户已在 mirai-console 登录 qq: 2839389290, }); } async function getGroupMsg() { bot.on("GroupMessage", async (data) => { await bot.sendMessage({ group: data.sender.group.id, message: new Message().addText("hello world!"), }); // 你可以像这样来判断群成员的权限 switch (data.sender.permission) { case Bot.groupPermission.OWNER: // 群主 break; case Bot.groupPermission.ADMINISTRATOR: // 管理员 break; case Bot.groupPermission.MEMBER: // 普通群成员 break; } }); } async function getFriendMsg() { await bot.sendMessage({ // 好友 qq 号 friend: '2329894267', // Message 实例,表示一条消息 message: new Message().addText('hello world!').addImageUrl('http://exapmle/image.jpg'), }); // bot.on("FriendRecallEvent", async (ctx) => { // const msg = await bot.getMessageById({ // messageId: 1, // target: 2329894267, // }); // console.log(msg); // }); } async function run() { console.log('111'); await conn(); setTimeout(() => { getFriendMsg(); }, 6 * 1000); print('222'); await bot.close({ keepConfig: true }); } run();
The text was updated successfully, but these errors were encountered:
麻烦提供更多上下文信息,比如 mirai-api-http 的版本号。
Sorry, something went wrong.
No branches or pull requests
代码如下,不知道为什么会报这个错
The text was updated successfully, but these errors were encountered: