Skip to content
Snippets Groups Projects

break down messages due to slack msg limit

Merged Zhang, Chen requested to merge fix_api_msg_len_limit_issue into main
1 file
+ 8
2
Compare changes
  • Side-by-side
  • Inline
+ 8
2
@@ -251,9 +251,15 @@ app = App(token=os.environ["SLACK_BOT_TOKEN"], name="Amaterasu")
def greetings(ack, say):
ack()
say("Build status summary for Neutron projects:")
status_blocks = {"blocks": get_status_blocks()}
say(status_blocks)
# NOTE: Slack API has a limit of 50 blocks per message, so we need to break it down
# into smaller messages
# 0. Legend
say({"blocks": legend()})
# 1. Gitlab projects
say({"blocks": gitlab_status_blocks()})
# 2. Github projects
say({"blocks": github_status_blocks() + mantid_block()})
# Start your app
if __name__ == "__main__":
Loading