MCPcopy Create free account
hub / github.com/NobyDa/Script / Opts

Function Opts

JD-DailyBonus/JD_DailyBonus.js:1760–1795  ·  view source on GitHub ↗
(rawopts)

Source from the content-addressed store, hash-verified

1758 })()
1759 const notify = (title, subtitle, message, rawopts) => {
1760 const Opts = (rawopts) => { //Modified from https://github.com/chavyleung/scripts/blob/master/Env.js
1761 if (!rawopts) return rawopts
1762 if (typeof rawopts === 'string') {
1763 if (isLoon) return rawopts
1764 else if (isQuanX) return {
1765 'open-url': rawopts
1766 }
1767 else if (isSurge) return {
1768 url: rawopts
1769 }
1770 else return undefined
1771 } else if (typeof rawopts === 'object') {
1772 if (isLoon) {
1773 let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url']
1774 let mediaUrl = rawopts.mediaUrl || rawopts['media-url']
1775 return {
1776 openUrl,
1777 mediaUrl
1778 }
1779 } else if (isQuanX) {
1780 let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl
1781 let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl
1782 return {
1783 'open-url': openUrl,
1784 'media-url': mediaUrl
1785 }
1786 } else if (isSurge) {
1787 let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url']
1788 return {
1789 url: openUrl
1790 }
1791 }
1792 } else {
1793 return undefined
1794 }
1795 }
1796 console.log(`${title}\n${subtitle}\n${message}`)
1797 if (isQuanX) $notify(title, subtitle, message, Opts(rawopts))
1798 if (isSurge) $notification.post(title, subtitle, message, Opts(rawopts))

Callers 1

notifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected