Define the requirements
Before you start development, note that this document helps you send group chat messages by calling the Custom bot sends group messages API through the Webhook of a Custom bot. The demo uses the sign request method. To help you get started quickly, run the sample demo provided in the Quickstart section. This gives you an intuitive experience of using a Custom bot.Prerequisites
-
Complete the Create a Custom bot procedure.
Select sign request as the security setting for the Custom bot. For details, see Custom bot security settings.
- Complete the Get the Webhook URL of a Custom bot procedure.
-
Prepare the development environment:
Quickstart
-
Download the sample demo:
-
Start the sample demo:
Procedure
The following is a Java example. For the Python example, download the demo above.
-
Add the dependencies to the
pom.xmlfile of the project. -
Create the main method and start it.
The message sent by the Custom bot then appears in the group.
FAQ
Rate limit
To prevent sending messages too frequently from degrading the group chat experience, the rate limit for messages sent by a Custom bot is as follows:Each bot can send a maximum of 20 messages per minute to a group. If the limit is exceeded, the bot is rate-limited for 10 minutes.
If you have scenarios with a large volume of messages, such as system monitoring alerts, consolidate the messages and send them as a summary to the group using markdown messages.