且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google Hangouts聊天机器人创建室

更新时间:2023-11-19 08:31:55

如果通常可以使用Hangous API以编程方式创建新房间,则可以使用聊天机器人来完成.

例如,如果您使用Apps脚本实现聊天框,您可以创建一个函数 ,然后在确定event.message.text的情况下进行建立(例如,如果消息文本包含字符串create new room,则创建一个新的聊天室.

If it were generally possible to create a new room programmaticaly with the Hangous API, you could do it with the chatbot.

For example, if you implement the chatbox with Apps Script, you can create a function onMessage(event) and establish was will to happen in case of a certain event.message.text (e.g. create a new chat room if the message text contains the string create new room.

但是,目前暂时无法以编程方式创建新的聊天室.

有一个功能请求,要求该功能,但考虑到潜在的滥用可能性,有争议的是它将被实施.

There is a feature request asking for this functionality, but given the potential of abuse, it is controversial either it will be implemented.

请参阅评论2:

您好,谢谢您的功能要求!目前房间无法 通过API创建,以防止滥用如漫游器或脚本 创建垃圾邮件室.但是,这种功能已经 在内部进行讨论,并且可能会在将来出现(与 限制).如果有更多信息,我将更新此问题 已发布.

Hello, thank you for the feature request! At the moment rooms cannot be created via the API to prevent abuse such as a bot or script spamming room creation. However, this kind of feature has been discussed internally and may be coming in the future (with limitations). I will update this issue if more information is released.

然后评论#25:

感谢您的输入.很高兴看到一些现实生活中的用例.我们 完全承认CreateRoom(DM)API的重要性,我们 积极研究正确的权限模型以允许机器人执行 所以.请继续关注此错误,因为我们将在此处发布更新 在适当的时候.

Thanks for the input. It's great to see some real life use cases. We fully acknowledge the importance of a CreateRoom(DM) API and we are actively looking into the right permission model to allow bots to do so. Please continue to follow this bug as we will post updates here when appropriate.