-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
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
Live Chat - Implement moderation #202
Conversation
Awesome! I'll review it in a bit. Thank you for your work on this! |
Now const itemMenu = await liveChat.getItemMenu(item);
itemMenu.selectItem('DELETE'); Also, we can get const itemMenu = await liveChat.getItemMenu(item);
const targetButton = itemMenu.menu().items[0];
itemMenu.selectItem(targetButton); I think we have one more task. My only idea is that |
I get what you're saying, the item menu is its own thing so that's why I suggested it to be a separate class. A generic button selector in the |
Finally I added I think all tasks about #202 is completed and it's ready to merge. Please review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Lgtm too!
I'll check the rest of the code to make sure we're not missing anything and then merge it ~
And again, thank you!
Also, rephrase a few error messages.
Description
I implemented moderation of live chat, which is mentioned at issue #186.
add
LiveChat.getItemMenu(item: ChatItemHasMenuEndpoint)
You can call this method with
ChatItemHasMenuEndpoint
: chat item which hasmenu_endpoint
member such asLiveChatTextMessage
, and get all endpoints for moderating the chat item whose type isPromise<Menu>
. You can call themoderation endpoint in the
Menu
instanse you got by followingLiveChat.selectButtonItem()
method.add
LiveChat.selectButtonItem(button: Button)
You can call chat moderation endpoint whose type is
Button
(or its sub class such asMenuServiceItem
) with this method.The modelation endpoint comes from the response of
LiveChat.getItemMenu()
,LiveChatTextMessage.inline_action_buttons
orLiveChatAutoModMessage.moderation_buttons
.fix some bugs
Here is a code example of new methods: Remove all LiveChatTextMessage that you have permittion for remove.
Implement #186
Type of change
Please delete options that are not relevant.
Checklist: