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:r=!1})=>{process.env.NODE_ENV==="development"&&console.log(o);let s=t[e];if(!!s)try{return await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blocks:[{type:"section",text:{type:"mrkdwn",text:`${r?"<@U0404G6J3NJ> ":""}${e==="alerts"||e==="errors"?":alert: ":""}${o}`}}]})})}catch(n){console.log(`Failed to log to Dub Slack. Error: ${n}`)}};export{c as a};
