WIP: [Ellipsis] Feature request: create an ice-breaking game in a group chat #310
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.