slack.py 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. MISSING_COMMAND = {
  2. "blocks": [
  3. {
  4. "type": "section",
  5. "text": {
  6. "type": "mrkdwn",
  7. "text": "Here are the commands you can use. Commands not working? Re-install the app!",
  8. },
  9. },
  10. {"type": "section", "text": {"type": "mrkdwn", "text": "*Direct Message Commands:*"}},
  11. {
  12. "type": "section",
  13. "text": {
  14. "type": "mrkdwn",
  15. "text": "`/sentry help`: View this list of commands.\n`/sentry link`: Link your Slack identity to your Sentry account to receive notifications. You'll also be able to perform actions in Sentry through Slack.\n`/sentry unlink`: Unlink your Slack identity from your Sentry account.",
  16. },
  17. },
  18. {"type": "section", "text": {"type": "mrkdwn", "text": "*Channel Commands:*"}},
  19. {
  20. "type": "section",
  21. "text": {
  22. "type": "mrkdwn",
  23. "text": "`/sentry link team`: Get your Sentry team's issue alert notifications in the channel this command is typed in.\n`/sentry unlink team`: Unlink a team from the channel this command is typed in.",
  24. },
  25. },
  26. {"type": "section", "text": {"type": "mrkdwn", "text": "*Contact:*"}},
  27. {
  28. "type": "section",
  29. "text": {
  30. "type": "mrkdwn",
  31. "text": "Let us know if you have feedback: ecosystem-feedback@sentry.io",
  32. },
  33. },
  34. {"type": "divider"},
  35. {
  36. "type": "section",
  37. "text": {
  38. "type": "mrkdwn",
  39. "text": "Just want to learn more about Sentry? Check out our <https://docs.sentry.io/product/integrations/notification-incidents/slack/|documentation>.",
  40. },
  41. },
  42. ]
  43. }
  44. INVALID_COMMAND = {
  45. "blocks": [
  46. {
  47. "type": "section",
  48. "text": {
  49. "type": "mrkdwn",
  50. "text": "Unknown command: `invalid command`",
  51. },
  52. },
  53. {
  54. "type": "section",
  55. "text": {
  56. "type": "mrkdwn",
  57. "text": "Here are the commands you can use. Commands not working? Re-install the app!",
  58. },
  59. },
  60. {
  61. "type": "section",
  62. "text": {"type": "mrkdwn", "text": "*Direct Message Commands:*"},
  63. },
  64. {
  65. "type": "section",
  66. "text": {
  67. "type": "mrkdwn",
  68. "text": "`/sentry help`: View this list of commands.\n`/sentry link`: Link your Slack identity to your Sentry account to receive notifications. You'll also be able to perform actions in Sentry through Slack.\n`/sentry unlink`: Unlink your Slack identity from your Sentry account.",
  69. },
  70. },
  71. {
  72. "type": "section",
  73. "text": {"type": "mrkdwn", "text": "*Channel Commands:*"},
  74. },
  75. {
  76. "type": "section",
  77. "text": {
  78. "type": "mrkdwn",
  79. "text": "`/sentry link team`: Get your Sentry team's issue alert notifications in the channel this command is typed in.\n`/sentry unlink team`: Unlink a team from the channel this command is typed in.",
  80. },
  81. },
  82. {"type": "section", "text": {"type": "mrkdwn", "text": "*Contact:*"}},
  83. {
  84. "type": "section",
  85. "text": {
  86. "type": "mrkdwn",
  87. "text": "Let us know if you have feedback: ecosystem-feedback@sentry.io",
  88. },
  89. },
  90. {"type": "divider"},
  91. {
  92. "type": "section",
  93. "text": {
  94. "type": "mrkdwn",
  95. "text": "Just want to learn more about Sentry? Check out our <https://docs.sentry.io/product/integrations/notification-incidents/slack/|documentation>.",
  96. },
  97. },
  98. ]
  99. }
  100. HELP_COMMAND = {
  101. "blocks": [
  102. {
  103. "text": {
  104. "text": "Here are the commands you can use. Commands not "
  105. "working? Re-install the app!",
  106. "type": "mrkdwn",
  107. },
  108. "type": "section",
  109. },
  110. {
  111. "text": {"text": "*Direct Message Commands:*", "type": "mrkdwn"},
  112. "type": "section",
  113. },
  114. {
  115. "text": {
  116. "text": "`/sentry help`: View this list of commands.\n"
  117. "`/sentry link`: Link your Slack identity to "
  118. "your Sentry account to receive notifications. "
  119. "You'll also be able to perform actions in "
  120. "Sentry through Slack.\n"
  121. "`/sentry unlink`: Unlink your Slack identity "
  122. "from your Sentry account.",
  123. "type": "mrkdwn",
  124. },
  125. "type": "section",
  126. },
  127. {
  128. "text": {"text": "*Channel Commands:*", "type": "mrkdwn"},
  129. "type": "section",
  130. },
  131. {
  132. "text": {
  133. "text": "`/sentry link team`: Get your Sentry team's "
  134. "issue alert notifications in the channel this "
  135. "command is typed in.\n"
  136. "`/sentry unlink team`: Unlink a team from the "
  137. "channel this command is typed in.",
  138. "type": "mrkdwn",
  139. },
  140. "type": "section",
  141. },
  142. {"text": {"text": "*Contact:*", "type": "mrkdwn"}, "type": "section"},
  143. {
  144. "text": {
  145. "text": "Let us know if you have feedback: " "ecosystem-feedback@sentry.io",
  146. "type": "mrkdwn",
  147. },
  148. "type": "section",
  149. },
  150. {"type": "divider"},
  151. {
  152. "text": {
  153. "text": "Just want to learn more about Sentry? Check out "
  154. "our "
  155. "<https://docs.sentry.io/product/integrations/notification-incidents/slack/|documentation>.",
  156. "type": "mrkdwn",
  157. },
  158. "type": "section",
  159. },
  160. ]
  161. }