ShareShortcuts

Pro Chat

\ Welcome to Pro Chat A chat app I made

procreations
„Pro Chat“ forken

Hast du auf Basis dieses Kurzbefehls etwas Neues erstellt? Teile ihn als Fork: Er wird zu deinem eigenen Kurzbefehl, den du selbst verwaltest, und beide Seiten verlinken aufeinander, damit procreations die Anerkennung erhält.

  1. 1Lade den Kurzbefehl und ändere ihn in der Kurzbefehle-App. Gib ihm einen eigenen Namen.
  2. 2Teile ihn in der Kurzbefehle-App und kopiere den iCloud-Link.
  3. 3Komm hierher zurück, füge den Link ein und beschreibe, was sich geändert hat, z. B. „Einen Schritt hinzugefügt, der Apple Intelligence nutzt, um den Text zu personalisieren.“
Downloads
27K
Gesichert
1
Aktionen
98
Kategorie
API
Version
1.0
Sprache
EN

# Welcome to Pro Chat

A chat app I made

Neue Funktionen

Version 1.0

First release

Versionsverlauf
1.0 1. Jan 2024

First release

Was er macht

98 Aktionen
  1. URL
    pro-chat.glitch.me
  2. Set Variable
    endpoint
  3. Dictionary
  4. Get File
  5. If
  6. Text
  7. Set Name
  8. Choose from List
  9. If
  10. Ask for Input
    Enter a username
  11. Ask for Input
    Enter a secure password
  12. Count
  13. If
  14. Show Alert
    ERROR
  15. Run Shortcut
    Chat App Test
  16. If
  17. Get Contents of URL
    …/signup
  18. Get Dictionary Value
  19. Get Dictionary Value
  20. Show Result
  21. If
  22. Dictionary
  23. Save File
  24. If
  25. Stop This Shortcut
  26. If
  27. Ask for Input
    Enter your username
  28. Ask for Input
    Enter your password
  29. Get Contents of URL
    …/login
  30. Get Dictionary Value
  31. Get Dictionary Value
  32. Show Result
  33. If
  34. Dictionary
  35. Save File
  36. If
  37. Stop This Shortcut
  38. If
  39. Set Variable
    user-data
  40. Get Dictionary Value
  41. Set Variable
    username
  42. Get Dictionary Value
  43. Set Variable
    password
  44. If
  45. Get Contents of URL
    …/getUsers
  46. Choose from List
  47. Text
  48. Set Name
  49. Choose from List
  50. If
  51. Ask for Input
    Enter your message
  52. Get Contents of URL
    …/sendDm
  53. If
  54. Get Contents of URL
    https://pro-chat.glitch.me/readDmsFrom
  55. Repeat with Each
  56. Get Dictionary Value
  57. Get Dictionary Value
  58. If
  59. Text
  60. If
  61. Text
  62. Text
  63. Combine Text
  64. Text
  65. Make Rich Text from HTML
  66. Quick Look
  67. If
  68. Run Shortcut
    Chat App Test
  69. Text
  70. Run Shortcut
    Chat App Test
  71. If
  72. Text
  73. Set Name
  74. Choose from List
  75. If
  76. Ask for Input
    Enter your message to send
  77. If
  78. Show Alert
    ERROR
  79. Run Shortcut
    Chat App Test
  80. Get Contents of URL
    …/send
  81. Run Shortcut
    Chat App Test
  82. If
  83. Get Contents of URL
    pro-chat.glitch.me/messages
  84. Get Item from List
  85. Repeat with Each
  86. Format Date
  87. Text
  88. Combine Text
  89. Text
  90. Make Rich Text from HTML
  91. Quick Look
  92. Run Shortcut
    Chat App Test
  93. If
  94. Text
  95. Run Shortcut
    Chat App Test
  96. If
  97. Show Result
  98. Run Shortcut
    Chat App Test

Als Code ansehen
Beta

Jede Aktion dieses Kurzbefehls als Cherri ausgeschrieben, eine Programmiersprache für Kurzbefehle. Ideal, um zu lernen, wie er funktioniert.

#include 'actions/web'
#define color blue
#define glyph person

url("pro-chat.glitch.me")
@endpoint
const File = getFileFromFolder(, "pro-chat/user-data.json", false)

if !File {
	const Text = "BEGIN:VCARD\rN;CHARSET=utf-8:Signup;;;;\r\nORG:Make an Pro Chat account\nPHOTO;ENCODING=b:{['icons.signup']}\rEND:VCARD\n\n\n\nBEGIN:VCARD\rN;CHARSET=utf-8:Login;;;;\r\nORG:Login to your existing Pro Chat account\nPHOTO;ENCODING=b:{['icons.login']}\rEND:VCARD\n\n\n\nBEGIN:VCARD\rN;CHARSET=utf-8:Exit;;;;\r\nORG:Exit Pro Chat\nPHOTO;ENCODING=b:{['icons.X']}\rEND:VCARD\n"
	const RenamedItem = setName(Text, "sign-in.vcf")
	const ChosenItem = chooseFromList(RenamedItem, "Pro Chat - Signup")
	if ChosenItem == "Signup" {
		prompt("Enter a username")
		const ProvidedInput = prompt("Enter a secure password")
		const Count = count(ProvidedInput, "Characters")
		if Count < 6 {
			alert("Password must be above 6 characters.", "ERROR")
			runSelf()
		} else {
			const ContentsOfURL = jsonRequest("{@endpoint}/signup", "POST", {
				"password": "{ProvidedInput}",
				"user": "{}"
			})
			const DictionaryValue = getValue(ContentsOfURL, "success")
			show()
			if DictionaryValue == "Login" {
				const Dictionary = {
					"password": "{ProvidedInput}",
					"user": "{}"
				}
				saveFile("/pro-chat/user-data.json", Dictionary)
			} else {
				stop()
			}
		}
	}
	if ChosenItem == "Login" {
		prompt("Enter your username")
		prompt("Enter your password")
		const ContentsOfURL1 = jsonRequest("{@endpoint}/login", "POST", {
			"password": "{}",
			"user": "{}"
		})
		const DictionaryValue1 = getValue(ContentsOfURL1, "success")
		show()
		if DictionaryValue1 == "Login" {
			const Dictionary1 = {
				"password": "{}",
				"user": "{}"
			}
			saveFile("/pro-chat/user-data.json", Dictionary1)
		} else {
			stop()
		}
	}
} else {
	@userdata = File
	@username = @userdata['user']
	@password = @userdata['password']
	if ShortcutInput contains "DM's" {
		const ContentsOfURL2 = jsonRequest("{@endpoint}/getUsers", "GET", {
			"message": "{ProvidedInput1}",
			"password": "{@password}",
			"user": "{@username}"
		})
		chooseFromList(ContentsOfURL2, "Select a user")
		const Text1 = "BEGIN:VCARD\rN;CHARSET=utf-8:Send message;;;;\r\nORG:Send a to {}\nPHOTO;ENCODING=b:{['icons.send']}\rEND:VCARD\n\n\n\n\n\nBEGIN:VCARD\rN;CHARSET=utf-8:View messages;;;;\r\nORG:View the messages {} has sent to you\nPHOTO;ENCODING=b:{['icons.view']}\rEND:VCARD\n\n\n\nBEGIN:VCARD\rN;CHARSET=utf-8:Back;;;;\r\nORG:Exit DM's\nPHOTO;ENCODING=b:{['icons.X']}\rEND:VCARD\n"
		const RenamedItem1 = setName(Text1, "dms.vcf")
		const ChosenItem1 = chooseFromList(RenamedItem1, "Pro Chat- DM's")
		if ChosenItem1 contains "Send" {
			prompt("Enter your message")
			jsonRequest("{@endpoint}/sendDm", "POST", {
				"message": "{}",
				"password": "{@password}",
				"receiver": "{}",
				"sender": "{@username}"
			})
		}
		if ChosenItem1 contains "View" {
			const ContentsOfURL3 = jsonRequest("https://pro-chat.glitch.me/readDmsFrom", "GET", {
				"message": "Hello world (test)",
				"password": "Agee",
				"receiver": "Omegabird113",
				"sender": "ProCreations"
			}, {
				"from": "{}",
				"password": "{@password}",
				"user": "{@username}"
			})
			for _ in ContentsOfURL3 {
				const message = @RepeatItem['message']
				const DictionaryValue2 = getValue(@RepeatItem, "sender")
				if DictionaryValue2 {
				} else {
				}
			}
			joinText(RepeatResults, "<hr>")
			const Text2 = "<html lang=\\"en\\">\n<head>\n  <meta charset=\\"UTF-8\\" />\n  <meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0, user-scalable=no\\" />\n  <title>Pro Chat</title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      margin: 0;\n      padding: 0;\n      background-color: #121212;\n      color: #aaa;\n    }\n    #messages-container {\n      max-width: 100%;\n      margin: 20px;\n      padding: 2rem;\n      background-color: #0A0A0A;\n      box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);\n      overflow-y: auto;\n      overflow-x: hidden;\n      border: none;\n      border-radius: 20px;\n    }\n\n    #messages {\n      list-style: none;\n      padding: 0;\n      margin: 0;\n    }\n\n    .message {\n      margin-bottom: 2rem;\n      padding: 1.8rem;\n      border: 1px solid #333;\n      border-radius: 15px;\n      background-color: #3D3D3D;\n    }\n\nsmall {\n  font-size: 70%;\n}\n\n  </style>\n</head>\n<body>\n  <div id=\\"messages-container\\">\n    <h2 style=\\"color: #aaa;\\">{}  DM's</h2>\n    <ul id=\\"messages\\">\n{}\n    </ul>\n  </div>\n<script>\n</script>\n</body>\n</html>"
			const RichTextFromHTML = getRichTextFromHTML(Text2)
			quicklook(RichTextFromHTML)
		}
		if ChosenItem1 == "Back" {
			runSelf()
		}
		const Text3 = "DM's"
		runSelf(Text3)
	} else {
		const Text4 = "BEGIN:VCARD\rN;CHARSET=utf-8:Send message;;;;\r\nORG:Send a message in Pro Chat!\nPHOTO;ENCODING=b:{['icons.send']}\rEND:VCARD\n\n\n\n\n\n\nBEGIN:VCARD\rN;CHARSET=utf-8:View messages;;;;\r\nORG:View the messages sent in Pro Chat\nPHOTO;ENCODING=b:{['icons.view']}\rEND:VCARD\n\n\n\nBEGIN:VCARD\rN;CHARSET=utf-8:Direct Messages;;;;\r\nORG:Chat privately with other Pro Chat users!\nPHOTO;ENCODING=b:{['icons.dm']}\rEND:VCARD\n\n\n\nBEGIN:VCARD\rN;CHARSET=utf-8:Settings;;;;\r\nORG:Pro Chat settings\nPHOTO;ENCODING=b:{['icons.settings']}\rEND:VCARD\n\n\n\nBEGIN:VCARD\rN;CHARSET=utf-8:Exit;;;;\r\nORG:Exit Pro Chat\nPHOTO;ENCODING=b:{['icons.X']}\rEND:VCARD\n"
		const RenamedItem2 = setName(Text4, "menu.vcf")
		const ChosenItem2 = chooseFromList(RenamedItem2, "Pro Chat- menu")
		if ChosenItem2 contains "Send" {
			const ProvidedInput1 = prompt("Enter your message to send")
			if ProvidedInput1 ==  {
				alert("Your message was empty. It has not been sent.", "ERROR")
				runSelf()
			}
			jsonRequest("{@endpoint}/send", "POST", {
				"message": "{ProvidedInput1}",
				"password": "{@password}",
				"user": "{@username}"
			})
			runSelf()
		}
		if ChosenItem2 contains "View" {
			const ContentsOfURL4 = downloadURL("pro-chat.glitch.me/messages")
			const ItemFromList = getListItems(ContentsOfURL4, 1, 200)
			for _ in ItemFromList {
				formatDate(@RepeatItem['date'], "Custom", "MMM d, h:mm a")
			}
			joinText(RepeatResults1, "
")
			const Text5 = "<html lang=\\"en\\">\n<head>\n  <meta charset=\\"UTF-8\\" />\n  <meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0, user-scalable=no\\" />\n  <title>Pro Chat</title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      margin: 0;\n      padding: 0;\n      background-color: #121212;\n      color: #aaa;\n    }\n    #messages-container {\n      max-width: 100%;\n      margin: 20px;\n      padding: 2rem;\n      background-color: #0A0A0A;\n      box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);\n      overflow-y: auto;\n      overflow-x: hidden;\n      border: none;\n      border-radius: 20px;\n    }\n\n    #messages {\n      list-style: none;\n      padding: 0;\n      margin: 0;\n    }\n\n    .message {\n      margin-bottom: 2rem;\n      padding: 1.8rem;\n      border: 1px solid #333;\n      border-radius: 15px;\n      background-color: #3D3D3D;\n    }\n\nsmall {\n  font-size: 70%;\n}\n\n  </style>\n</head>\n<body>\n  <div id=\\"messages-container\\">\n    <h2 style=\\"color: #aaa;\\">Messages</h2>\n    <ul id=\\"messages\\">\n{}\n    </ul>\n<p>Pro Chat shortcut only loads 200 messages to save speed.</p>\n  </div>\n<script>\n</script>\n</body>\n</html>"
			const RichTextFromHTML1 = getRichTextFromHTML(Text5)
			quicklook(RichTextFromHTML1)
			runSelf()
		}
		if ChosenItem2 contains "Direct" {
			const Text6 = "DM's"
			runSelf(Text6)
		}
		if ChosenItem2 == "Settings" {
			show("Settings option coming soon!")
			runSelf()
		}
	}
}
Mit cherri 2.3.0 (GPL-2.0) dekompiliert. Eventuell sind kleine Korrekturen nötig, bevor es kompiliert wird.

Bewertungen und Rezensionen

Rezension schreiben
–
von 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Werbung

Mehr von procreations

Alle anzeigen

Das gefällt dir vielleicht auch

Alle anzeigen
Werbung