var n={alerts:process.env.DUB_SLACK_HOOK_ALERTS,cron:process.env.DUB_SLACK_HOOK_CRON,errors:process.env.DUB_SLACK_HOOK_ERRORS,links:process.env.DUB_SLACK_HOOK_LINKS,payouts:process.env.DUB_SLACK_HOOK_PAYOUTS},c=async({message:e,type:o,mention:s=!1})=>{console.log(e);let r=n[o];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> ":""}${o==="alerts"||o==="errors"?":alert: ":""}${e}`}}]})})}catch(t){console.log(`Failed to log to Dub Slack. Error: ${t}`)}};export{c as a};
