vd-plugins/MoreConfirm/index.js
2023-02-16 08:16:10 +00:00

1 line
766 B
JavaScript

(function(o,t,e){"use strict";const i=e.findByProps("show","confirm","close"),s=e.findByProps("handleStartCall");var u={onLoad:function(){t.logger.log("MoreConfirm: patching calls..."),t.patcher.instead("handleStartCall",s,function(n,d){const[{rawRecipients:[{username:a,discriminator:l},c]},f]=n,r=f?"video call":"call";i.show({title:c?`MoreConfirm: Start a group ${r}?`:`MoreConfirm: Start a ${r} with ${a}#${l}?`,body:c?"Are you sure you want to start the group call?":`Are you sure you want to ${r} ${a}#${l}?`,confirmText:"Yes",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){try{d(...n)}catch(h){t.logger.error("Failed to start call",h)}}})})}};return o.default=u,Object.defineProperty(o,"__esModule",{value:!0}),o})({},vendetta,vendetta.metro);