MCPcopy Create free account
hub / github.com/Semporia/Scripts / Opts

Function Opts

JD_DailyBonus.js:1752–1787  ·  view source on GitHub ↗
(rawopts)

Source from the content-addressed store, hash-verified

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

Callers 1

notifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected