WIP: [Ellipsis] Feature request: create an ice-breaking game in a group chat#310
WIP: [Ellipsis] Feature request: create an ice-breaking game in a group chat#310ellipsis-dev[bot] wants to merge 1 commit intomainfrom
Conversation
|
Important Auto Review SkippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Summary:
Issue: resolves #309
Implementation:
Step 1: Add command handling for the ice-breaking game
Add code to handle the '/☕️' command in the group chat. This code should be added in the file where commands are handled. If the command is sent in the group with the topic 'The Big Community', the game should be triggered. The person who sent the command should be set as the initiator of the game. If the command is sent in a group with less than 3 members, a message should be sent to the group informing them that the game can't be started because there are not enough members.
Step 2: Modify group creation code to select random members
Modify the 'createDingRoom' function in the file '/examples/advanced/room-bot.js' to select two random members from the group instead of adding specific contacts. Use a random number generator to select the members and check that the same member is not selected twice. Set the topic of the new group to 'Coffee Chat' and the initiator of the game as the person who sent the command. Add a check to ensure that the group has at least 3 members before starting the game.
Step 3: Add a welcome message to the new group
Use the
say()method of the room object to send a welcome message to the new group. The message should be formatted as 'Welcome to the coffee chat group! This group is requested by ${INITIATOR_NAME}, and your random partners are ${GAMERS_NAME}. I hope you guys have a good ice-breaking time!'. Replace ${INITIATOR_NAME} with the name of the initiator and ${GAMERS_NAME} with the names of the gamers.Step 4: Add code to dismiss the group if there are less than 3 people in it
Add code to check the number of members in the group and dismiss the group if there are less than 3 people in it. This code should be added in the file where the group chat functionality is handled. Use the methods for removing members from a room to dismiss the group.
Report:
Add command handling for the ice-breaking game
Implemented the feature request to create an ice-breaking game in a group chat. Added command handling for the '/☕️' command, modified the group creation code to select random members, added a welcome message to the new group, and added code to dismiss the group if there are less than 3 people in it.Modify group creation code to select random members
No resultAdd a welcome message to the new group
No resultAdd code to dismiss the group if there are less than 3 people in it
No resultSomething look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #309. Then, try again. For more information, check the documentation.