blob: 704c552bfe6027403a9da74f503d274af93985cd [file] [log] [blame]
"use strict";(self.webpackChunkhertzbeat=self.webpackChunkhertzbeat||[]).push([[58731],{15680:(e,t,o)=>{o.d(t,{xA:()=>d,yg:()=>g});var n=o(96540);function a(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function r(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function i(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?r(Object(o),!0).forEach((function(t){a(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function c(e,t){if(null==e)return{};var o,n,a=function(e,t){if(null==e)return{};var o,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||(a[o]=e[o]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(a[o]=e[o])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),o=t;return e&&(o="function"==typeof e?e(t):i(i({},t),e)),o},d=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var o=e.components,a=e.mdxType,r=e.originalType,l=e.parentName,d=c(e,["components","mdxType","originalType","parentName"]),h=s(o),g=a,b=h["".concat(l,".").concat(g)]||h[g]||p[g]||r;return o?n.createElement(b,i(i({ref:t},d),{},{components:o})):n.createElement(b,i({ref:t},d))}));function g(e,t){var o=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=o.length,i=new Array(r);i[0]=h;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var s=2;s<r;s++)i[s]=o[s];return n.createElement.apply(null,i)}return n.createElement.apply(null,o)}h.displayName="MDXCreateElement"},10920:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>p,frontMatter:()=>r,metadata:()=>c,toc:()=>s});var n=o(58168),a=(o(96540),o(15680));const r={id:"alert_discord",title:"Alert Discord Bot Notifications",sidebar_label:"Alert Discord bot notification",keywords:["open source monitoring tool","open source alerter","open source Discord bot notification"]},i=void 0,c={unversionedId:"help/alert_discord",id:"version-v1.1.x/help/alert_discord",title:"Alert Discord Bot Notifications",description:"Send an alarm message after the threshold is triggered, and notify the recipient through the Discord robot.",source:"@site/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_discord.md",sourceDirName:"help",slug:"/help/alert_discord",permalink:"/docs/v1.1.x/help/alert_discord",draft:!1,editUrl:"https://github.com/dromara/hertzbeat/edit/master/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_discord.md",tags:[],version:"v1.1.x",frontMatter:{id:"alert_discord",title:"Alert Discord Bot Notifications",sidebar_label:"Alert Discord bot notification",keywords:["open source monitoring tool","open source alerter","open source Discord bot notification"]},sidebar:"docs",previous:{title:"Alert webHook notification",permalink:"/docs/v1.1.x/help/alert_webhook"},next:{title:"Alert Slack Webhook Notification",permalink:"/docs/v1.1.x/help/alert_slack"}},l={},s=[{value:"Steps",id:"steps",level:2},{value:"Create an application in Discord, create a robot under the application, and get the robot Token",id:"create-an-application-in-discord-create-a-robot-under-the-application-and-get-the-robot-token",level:3},{value:"Enable developer mode and get Channel ID",id:"enable-developer-mode-and-get-channel-id",level:3},{value:"Add an alarm notification person in HertzBeat, the notification method is Discord Bot",id:"add-an-alarm-notification-person-in-hertzbeat-the-notification-method-is-discord-bot",level:3},{value:"Discord Bot Notification FAQ",id:"discord-bot-notification-faq",level:3}],d={toc:s};function p(e){let{components:t,...r}=e;return(0,a.yg)("wrapper",(0,n.A)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"Send an alarm message after the threshold is triggered, and notify the recipient through the Discord robot.")),(0,a.yg)("h2",{id:"steps"},"Steps"),(0,a.yg)("h3",{id:"create-an-application-in-discord-create-a-robot-under-the-application-and-get-the-robot-token"},"Create an application in Discord, create a robot under the application, and get the robot Token"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},"Visit ",(0,a.yg)("a",{parentName:"li",href:"https://discord.com/developers/applications"},"https://discord.com/developers/applications")," to create an application")),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"bot",src:o(15794).A,width:"3808",height:"510"})),(0,a.yg)("ol",{start:2},(0,a.yg)("li",{parentName:"ol"},"Create a robot under the application and get the robot Token")),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"bot",src:o(6505).A,width:"3800",height:"948"})),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"bot",src:o(51680).A,width:"3806",height:"1556"})),(0,a.yg)("ol",{start:3},(0,a.yg)("li",{parentName:"ol"},"Authorize the bot to the chat server")),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"Authorize the robot under the OAuth2 menu, select ",(0,a.yg)("inlineCode",{parentName:"p"},"bot")," for ",(0,a.yg)("inlineCode",{parentName:"p"},"SCOPES"),", ",(0,a.yg)("inlineCode",{parentName:"p"},"BOT PERMISSIONS")," select ",(0,a.yg)("inlineCode",{parentName:"p"},"Send Messages"))),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"bot",src:o(3007).A,width:"3556",height:"1684"})),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"Obtain the URL generated at the bottom, and the browser accesses this URL to officially authorize the robot, that is, to set which chat server the robot will join.")),(0,a.yg)("ol",{start:4},(0,a.yg)("li",{parentName:"ol"},"Check if your chat server has joined robot members")),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"bot",src:o(6678).A,width:"2784",height:"1664"})),(0,a.yg)("h3",{id:"enable-developer-mode-and-get-channel-id"},"Enable developer mode and get Channel ID"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},"Personal Settings -> Advanced Settings -> Enable Developer Mode")),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"bot",src:o(88301).A,width:"2784",height:"1664"})),(0,a.yg)("ol",{start:2},(0,a.yg)("li",{parentName:"ol"},"Get channel Channel ID")),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"Right-click the chat channel you want to send the robot message to, click the COPY ID button to get the Channel ID")),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"bot",src:o(48356).A,width:"2784",height:"1664"})),(0,a.yg)("h3",{id:"add-an-alarm-notification-person-in-hertzbeat-the-notification-method-is-discord-bot"},"Add an alarm notification person in HertzBeat, the notification method is Discord Bot"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("strong",{parentName:"li"},"[Alarm notification]"," -> ","[Add recipient]"," -> ","[Select Discord robot notification method]"," -> ","[Set robot Token and ChannelId]"," -> ","[OK]"))),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"email",src:o(6019).A,width:"3816",height:"1110"})),(0,a.yg)("ol",{start:4},(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("strong",{parentName:"li"},"Configure the associated alarm notification strategy\u26a0\ufe0f ","[Add notification strategy]"," -> ","[Associate the recipient just set]"," -> ","[OK]"))),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},(0,a.yg)("strong",{parentName:"p"},"Note \u26a0\ufe0f Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients"),".")),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"email",src:o(82174).A,width:"3778",height:"1284"})),(0,a.yg)("h3",{id:"discord-bot-notification-faq"},"Discord Bot Notification FAQ"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},"Discord doesn't receive bot alert notifications ")),(0,a.yg)("blockquote",null,(0,a.yg)("p",{parentName:"blockquote"},"Please check whether the alarm information has been triggered in the alarm center",(0,a.yg)("br",{parentName:"p"}),"\n","Please check whether the robot Token and ChannelId are configured correctly, and whether the alarm policy association has been configured",(0,a.yg)("br",{parentName:"p"}),"\n","Please check whether the bot is properly authorized by the Discord chat server ")),(0,a.yg)("p",null,"Other questions can be fed back through the communication group ISSUE!"))}p.isMDXComponent=!0},82174:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/alert-notice-policy-a44e898a35d581c7bb8f52bd2499387f.png"},15794:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/discord-bot-1-9d0b65e14924ead1442e6116e31bf4c2.png"},6505:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/discord-bot-2-7907568f2095b25da09696cad8de72d1.png"},51680:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/discord-bot-3-bc899ee5c9b15a1f5b85690764670d86.png"},3007:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/discord-bot-4-757e196258496be2d97af0c5f44b57a8.png"},6678:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/discord-bot-5-71ca8be9f969c09f246a517b04eceaad.png"},88301:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/discord-bot-6-cae99ad2f0afb31a246d6370968cb5d1.png"},48356:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/discord-bot-7-436fdcda3b47272b26262b8ee85eb7b2.png"},6019:(e,t,o)=>{o.d(t,{A:()=>n});const n=o.p+"assets/images/discord-bot-8-fa3ec9bd0f55406493696a0bce0267db.png"}}]);