var t={alerts:process.env.DUB_SLACK_HOOK_ALERTS,cron:process.env.DUB_SLACK_HOOK_CRON,links:process.env.DUB_SLACK_HOOK_LINKS,subscribers:process.env.DUB_SLACK_HOOK_SUBSCRIBERS,errors:process.env.DUB_SLACK_HOOK_ERRORS},c=async({message:o,type:e,mention:s=!1})=>{console.log(o);let r=t[e];if(!!r)try{return await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blocks:[{type:"section",text:{type:"mrkdwn",text:`${s?"<@U0404G6J3NJ> ":""}${e==="alerts"||e==="errors"?":alert: ":""}${o}`}}]})})}catch(n){console.log(`Failed to log to Dub Slack. Error: ${n}`)}};export{c as a};
