Loading
function(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(735438),i=n.n(r),s=n(562465),a=n(73153),o=n(652215);let l=["Spidey Bot","Captain Hook"],u={fetchForGuild(e){a.h.dispatch({type:"WEBHOOKS_FETCHING",guildId:e}),s.Bo.get({url:o.Rsh.GUILD_WEBHOOKS(e),oldFormErrors:!0,rejectWithError:!1}).then(t=>{let{body:n}=t;return a.h.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,webhooks:n})}).catch(t=>{let{body:n}=t;a.h.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,error:n.message})})},fetchForChannel(e,t){a.h.dispatch({type:"WEBHOOKS_FETCHING",guildId:e,channelId:t}),s.Bo.get({url:o.Rsh.CHANNEL_WEBHOOKS(t),oldFormErrors:!0,rejectWithError:!0}).then(n=>{let{body:r}=n;return a.h.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,channelId:t,webhooks:r})}).catch(t=>{let{body:n}=t;a.h.dispatch({type:"WEBHOOKS_UPDATE",guildId:e,error:n.message})})},create:(e,t,n)=>(null==n&&(n=l[i().random(0,l.length-1)]),s.Bo.post({url:o.Rsh.CHANNEL_WEBHOOKS(t),body:{name:n},oldFormErrors:!0,rejectWithError:!1}).then(t=>{let{body:n}=t;return a.h.dispatch({type:"WEBHOOK_CREATE",guildId:e,webhook:n}),n})),delete:(e,t)=>s.Bo.del({url:o.Rsh.WEBHOOK(t),oldFormErrors:!0,rejectWithError:!1}).then(()=>{a.h.dispatch({type:"WEBHOOK_DELETE",guildId:e,webhookId:t})}),update:(e,t,n)=>s.Bo.patch({url:o.Rsh.WEBHOOK(t),body:n,oldFormErrors:!0,rejectWithError:!1}).then(t=>{let{body:n}=t;return a.h.dispatch({type:"WEBHOOK_UPDATE",guildId:e,webhook:n}),n})}}