This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set up keychain and token | |
const namespace = "dscrd.wdgt" | |
const token = `${namespace}.usertoken` | |
if (!Keychain.contains(token) || !Keychain.get(token)) { | |
let alert = new Alert() | |
alert.title = "Enter Discord User Token" | |
alert.addTextField("<discord_token>") | |
await alert.presentAlert() | |
Keychain.set(token, alert.textFieldValue(0) || "") | |
} |