Skip to content

Instantly share code, notes, and snippets.

Avatar

chimcen

  • Germany, Mühldorf am Inn
View GitHub Profile
@chimcen
chimcen / DiscordWidget.js
Created Nov 13, 2020 — forked from heptal/DiscordWidget.js
Recent Discord channel/DM messages shown in iOS14 widget - built with Scriptable.app
View DiscordWidget.js
// 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) || "")
}