Issue: When trying to send a system message using the type: "system"
, users are prompted to set a user_id
, which can be confusing as the system itself is sending the message.
Solution: To send a system message, you can use a dedicated "system user" as the user_id
. For example:
await channel.sendMessage({
text: "Stream test 2",
type: "system",
user_id: "my_system_user",
});
Details:
- The
my_system_user
in this case can be a regular user created for the purpose of sending system messages. - When sending messages from the backend, there are no permission checks applied, so there is no need to worry about roles, teams, or multitenancy issues.
- Never issue a JWT for a user trying to request a token as "my_system_user"
- This
my_system_user
can be used across different teams and conversations.
Recommendation: Consider creating a "system user" for this purpose. This user will act as the sender for all system messages, and no additional permission handling is required.
Comments
0 comments
Please sign in to leave a comment.