Comments (14)
Group ding dong succeeded!
how to tell Room.say from Contact.say, since QQ group number and QQ account number can be same?
Have you got the solutions to it? Our current design in Puppet API is using a conversationId for both contact and room.
Currently, the puppet will check if conversationId is in bot account's added group list. If bot has join group of conversationId, it will send the message to the group. Otherwise, a private message will be sent to qq of conversationId.
from puppet-oicq.
The code looks good, I believe the problem of that qq and group number can be same can be solved with our latest version of the code.
I think the problem is of course solved with this commit, because we dispatch private and group message send by prefix group_
or qq_
https://github.com/wechaty/puppet-oicq/blob/main/src/puppet-oicq.ts#L237-L249
from puppet-oicq.
messageSendText(conversationId, text)
is using for both Contact.say and Room.say.
Please refer to the below example code and feel free to let me know your questions by replying to this issue.
Send room message code example
from puppet-oicq.
how to tell Room.say from Contact.say, since QQ group number and QQ account number can be same?
from puppet-oicq.
roomRawPayload and roomRawPayloadParser has been implemented, and room name of a room message could be shown in terminal.
17:47:11 INFO StarterBot Message#Text[🗣Contact<Li Dao>@👥Room<内部测试群>] ding
17:47:11 VERB Message say(dong)
17:47:11 VERB Puppet selfId()
17:47:11 VERB Puppet selfId()
17:47:11 VERB Message mentionList()
17:47:11 VERB Message mentionList() text = "ding", mentionNameList = "[]"
17:47:17 VERB Message static load(LaGHkzKIqqUAAAAunlM4/2Fr8SUB)
17:47:17 VERB Message constructor(LaGHkzKIqqUAAAAunlM4/2Fr8SUB) for class WechatifiedMessage
17:47:17 VERB Message ready()
17:47:17 VERB Puppet messagePayload(LaGHkzKIqqUAAAAunlM4/2Fr8SUB)
17:47:17 VERB Room ready()
17:47:17 VERB Puppet selfId()
17:47:17 INFO StarterBot Message#Text[🗣Contact<Li Dao>@👥Room<内部测试群>] asdf
from puppet-oicq.
If someone say message in group, and he is not a friend of the bot. contactRawPayload
could not find contact info from this.contactStore
.
To fix this problem. We will add a person's info to this.contactStore
after he says something in group if he is not a friend of bot.
from puppet-oicq.
how to tell Room.say from Contact.say, since QQ group number and QQ account number can be same?
Have you got the solutions to it? Our current design in Puppet API is using a conversationId
for both contact and room.
roomRawPayload and roomRawPayloadParser has been implemented, and room name of a room message could be shown in terminal.
That's great, good job!
To fix this problem. We will add a person's info to this.contactStore after he says something in the group if he is not a friend of the bot.
My suggestion is to use the puppet.roomMemberPayload
related API for contact payloads who are not friends of the bot but in a QQ group / WeChat room. You can refer to the WeChat Web puppet at here
from puppet-oicq.
Congratulations!
Could you please help us to confirm the QQ account provided by @krapnikkk can work with our QQ ding/dong bot?
If we can have the QQ account worked, then I believe we can try to integrate our Friday BOT with QQ soon!
Currently, the puppet will check if a conversation is in the bot account's added group list. If the bot has joined the group of conversationId, it will send the message to the group. Otherwise, a private message will be sent to QQ of conversationId.
It's a good workaround. I hope we can find a way to deal with it better in the future.
from puppet-oicq.
I reopen this issue because we need to improve the puppet code to better deal with the oicq protocol.
According to this link, the QQ number and the group number might be exactly the same.
This is a challenge of our current puppet design: we are using a conversationId
for sending messages to, which means we need to differentiate the number of QQ and the Group.
For example, we can add a prefix to achieve that:
qq_xxx
means qq user numbergroup_xxx
means qq group number
We can do the conversion inside the puppet-oicq from and to the OICQ.
Please feel free to let me know if you have any questions and good ideas.
from puppet-oicq.
Got it. I try to change to this pattern, a problem is:
If someone says ding
on Group, puppet will be called with conversationId=qq_xxx
in messageSendText, and bot will send dong
to this people by private message instead of in group, is it expected?
from puppet-oicq.
I found that if we use ding-dong bot of wechaty-getting-started
, bot will reply dong
on QQ group.
Because it called msg.say('dong')
If we use run the puppet directly, bot will reply dong
to the person in private message, for it called await puppet.messageSendText(msgPayload.fromId!, 'dong')
from puppet-oicq.
I reopen this issue because we need to improve the puppet code to better deal with the oicq protocol.
According to this link, the QQ number and the group number might be exactly the same.
This is a challenge of our current puppet design: we are using a
conversationId
for sending messages to, which means we need to differentiate the number of QQ and the Group.For example, we can add a prefix to achieve that:
qq_xxx
means qq user numbergroup_xxx
means qq group numberWe can do the conversion inside the puppet-oicq from and to the OICQ.
Please feel free to let me know if you have any questions and good ideas.
I think commit ae0053e has implemented all of these. And [email protected]
is released.
fromId and roomId has been changed as asked above.
{"fromId":"qq_1962099319","id":"dPNCdwAAAAll+k9fYXPYZQE=","text":"Wechaty login","timestamp":1634981990088,"type":7,"toId":"qq_1962099319"}
{"fromId":"qq_847817381","id":"LaGHkzKIqqUAAABWzeCF12Fz2GcB","text":"ding","timestamp":1634981991493,"type":7,"roomId":"group_765560723"}
from puppet-oicq.
The code looks good, I believe the problem of that qq and group number can be same can be solved with our latest version of the code.
from puppet-oicq.
Of course.
Thank you very much for the clarifying!
from puppet-oicq.
Related Issues (20)
- Remove the code from reading the stdin: "enter pressed, try to login" HOT 10
- Disable the output message from `oicq` HOT 1
- Make the PuppetOICQ to be "perfect restart"-able HOT 2
- Could not run wechaty-getting-started after use npm link HOT 8
- Call for volunteering QQ account: create a QQ group for Wechaty Developers' Home HOT 1
- Support Friendship receive & accept
- Support RoomInvitation receive & accept HOT 6
- PuppetLoginMixin selfId() is deprecated, use `currentUserId` instead: HOT 2
- Store `data/` data to MemoryCard and load from MemoryCard when start
- `CQ` code parsing HOT 4
- Support to get room member alias in the room.
- Support room events
- Support `room.add()` to invite others join the room.
- Handling breaking changes in oicq v2.x HOT 3
- `Wechaty.Room.find()` not work properly with v1.x
- Support `puppetOptions.qq` using `string` HOT 1
- Support say image: `messageSendImage` HOT 1
- Support say UrlLink: `messageSendUrl` HOT 2
- Support `roomList` to list all the groups that the qq bot has joined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-oicq.