Discord Status Animator (Manual edit/Non-UI)

Automatically changes your Discord status

当前为 2021-06-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Discord Status Animator (Manual edit/Non-UI)
  3. // @namespace https://github.com/Hakorr/discord-status-animator
  4. // @run-at document-start
  5. // @version 1.6
  6. // @description Automatically changes your Discord status
  7. // @author HKR
  8. // @match https://discord.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. //Welcome! Don't be scared by the code, I was too lazy to do an UI for this.
  13. //Visit the Github for more more instructions! github.com/Hakorr/discord-status-animator
  14.  
  15. var name = "Status Animator";
  16. var version = "V1.6";
  17. var run = true;
  18.  
  19. //A Cookie will be made with this name, feel free to edit it
  20. //DO NOT SHARE THIS COOKIE WITH ANYONE AS IT'S YOUR DISCORD TOKEN
  21. var cookie_name = "DoNotShareThisToken";
  22. var delete_cookie_after_a_week = true;
  23.  
  24. //Your status will be changed to these after you close the Discord tab
  25. var default_status_text = "";
  26. var default_status_emoji = "";
  27. var default_status_state = "online";
  28.  
  29. async function statusanimation() {
  30. //This is your animation code///////
  31. ////////////////////////////////////
  32.  
  33. await blink("🥳","I'm using Discord Status Animator!",2000,1);
  34.  
  35. if(await skip(10,"unique")) return;
  36.  
  37. await settext("Get it here! Github.com/Hakorr/discord-status-animator");
  38. await wait(5000);
  39.  
  40. ////////////////////////////////////
  41. //Your animation code ends here/////
  42. }
  43.  
  44. /////////////////////////////////////
  45. /* ANIMATION BLOCKS /////////////////
  46. Timeouts are in milliseconds! You can type "random" on the emoji section to randomize it!
  47. - await wait(ms);
  48. - await blank();
  49. - await setstate("state");
  50. -> states = invisible, dnd, idle, online
  51. - await setemoji("emoji");
  52. - await settext("text");
  53. - await status(emoji,text,state);
  54. -> states = invisible, dnd, idle, online
  55. - await typewriter("emoji","text",timeout,reversed);
  56. - await glitch("emoji","text",times,timeout);
  57. - await glitchtype("emoji","text",timeout,glitch_rate,reversed);
  58. - await sentence("emoji","text",timeout);
  59. - await blink("emoji","text",timeout,times);
  60. - await count("emoji","prefix",count_to,"suffix",timeout,reversed);
  61. - if(await skip(1,"unique")) return;
  62. -> The unique string can be anything. If you use two skips, remember to make each one different.
  63. //Do not edit after this line (If you don't know what you're doing)
  64. /*///////////////////////////////////////////////////////////////*/
  65. ///////////////////////////////////////////////////////////////////
  66.  
  67. function random_emoji() {
  68.  
  69. var emojis = [
  70. '😄','😃','😀','😊','😉','😍','😘','😚','😗','😙','😜','😝','😛','😳','😁','😔','😌','😒','😞','😣','😢','😂','😭','😪','😥','😰','😅','😓','😩','😫','😨','😱','😠','😡','😤','😖','😆','😋','😷','😎','😴','😵','😲','😟','😦','😧','😈','👿','😮','😬','😐','😕','😯','😶','😇','😏','😑','👲','👳','👮','👷','💂','👶','👦','👧','👨','👩','👴','👵','👱','👼','👸','😺','😸','😻','😽','😼','🙀','😿','😹','😾','👹','👺','🙈','🙉','🙊','💀','👽','💩','🔥','✨','🌟','💫','💥','💢','💦','💧','💤','💨','👂','👀','👃','👅','👄','👍','👎','👌','👊','✊','✌','👋','✋','👐','👆','👇','👉','👈','🙌','🙏','☝','👏','💪','🚶','🏃','💃','👫','👪','👬','👭','💏','💑','👯','🙆','🙅','💁','🙋','💆','💇','💅','👰','🙎','🙍','🙇','🎩','👑','👒','👟','👞','👡','👠','👢','👕','👔','👚','👗','🎽','👖','👘','👙','💼','👜','👝','👛','👓','🎀','🌂','💄','💛','💙','💜','💚','❤','💔','💗','💓','💕','💖','💞','💘','💌','💋','💍','💎','👤','👥','💬','👣','💭','🐶','🐺','🐱','🐭','🐹','🐰','🐸','🐯','🐨','🐻','🐷','🐽','🐮','🐗','🐵','🐒','🐴','🐑','🐘','🐼','🐧','🐦','🐤','🐥','🐣','🐔','🐍','🐢','🐛','🐝','🐜','🐞','🐌','🐙','🐚','🐠','🐟','🐬','🐳','🐋','🐄','🐏','🐀','🐃','🐅','🐇','🐉','🐎','🐐','🐓','🐕','🐖','🐁','🐂','🐲','🐡','🐊','🐫','🐪','🐆','🐈','🐩','🐾','💐','🌸','🌷','🍀','🌹','🌻','🌺','🍁','🍃','🍂','🌿','🌾','🍄','🌵','🌴','🌲','🌳','🌰','🌱','🌼','🌐','🌞','🌝','🌚','🌑','🌒','🌓','🌔','🌕','🌖','🌗','🌘','🌜','🌛','🌙','🌍','🌎','🌏','🌋','🌌','🌠','⭐','☀','⛅','☁','⚡','☔','❄','⛄','🌀','🌁','🌈','🌊','🎍','💝','🎎','🎒','🎓','🎏','🎆','🎇','🎐','🎑','🎃','👻','🎅','🎄','🎁','🎋','🎉','🎊','🎈','🎌','🔮','🎥','📷','📹','📼','💿','📀','💽','💾','💻','📱','☎','📞','📟','📠','📡','📺','📻','🔊','🔉','🔈','🔇','🔔','🔕','📢','📣','⏳','⌛','⏰','⌚','🔓','🔒','🔏','🔐','🔑','🔎','💡','🔦','🔆','🔅','🔌','🔋','🔍','🛁','🛀','🚿','🚽','🔧','🔩','🔨','🚪','🚬','💣','🔫','🔪','💊','💉','💰','💴','💵','💷','💶','💳','💸','📲','📧','📥','📤','✉','📩','📨','📯','📫','📪','📬','📭','📮','📦','📝','📄','📃','📑','📊','📈','📉','📜','📋','📅','📆','📇','📁','📂','✂','📌','📎','✒','✏','📏','📐','📕','📗','📘','📙','📓','📔','📒','📚','📖','🔖','📛','🔬','🔭','📰','🎨','🎬','🎤','🎧','🎼','🎵','🎶','🎹','🎻','🎺','🎷','🎸','👾','🎮','🃏','🎴','🀄','🎲','🎯','🏈','🏀','⚽','⚾','🎾','🎱','🏉','🎳','⛳','🚵','🚴','🏁','🏇','🏆','🎿','🏂','🏊','🏄','🎣','☕','🍵','🍶','🍼','🍺','🍻','🍸','🍹','🍷','🍴','🍕','🍔','🍟','🍗','🍖','🍝','🍛','🍤','🍱','🍣','🍥','🍙','🍘','🍚','🍜','🍲','🍢','🍡','🍳','🍞','🍩','🍮','🍦','🍨','🍧','🎂','🍰','🍪','🍫','🍬','🍭','🍯','🍎','🍏','🍊','🍋','🍒','🍇','🍉','🍓','🍑','🍈','🍌','🍐','🍍','🍠','🍆','🍅','🌽','🏠','🏡','🏫','🏢','🏣','🏥','🏦','🏪','🏩','🏨','💒','⛪','🏬','🏤','🌇','🌆','🏯','🏰','⛺','🏭','🗼','🗾','🗻','🌄','🌅','🌃','🗽','🌉','🎠','🎡','⛲','🎢','🚢','⛵','🚤','🚣','⚓','🚀','✈','💺','🚁','🚂','🚊','🚉','🚞','🚆','🚄','🚅','🚈','🚇','🚝','🚋','🚃','🚎','🚌','🚍','🚙','🚘','🚗','🚕','🚖','🚛','🚚','🚨','🚓','🚔','🚒','🚑','🚐','🚲','🚡','🚟','🚠','🚜','💈','🚏','🎫','🚦','🚥','⚠','🚧','🔰','⛽','🏮','🎰','♨','🗿','🎪','🎭','📍','🚩','⬆','⬇','⬅','➡','🔠','🔡','🔤','↗','↖','↘','↙','↔','↕','🔄','◀','▶','🔼','🔽','↩','↪','ℹ','⏪','⏩','⏫','⏬','⤵','⤴','🆗','🔀','🔁','🔂','🆕','🆙','🆒','🆓','🆖','📶','🎦','🈁','🈯','🈳','🈵','🈴','🈲','🉐','🈹','🈺','🈶','🈚','🚻','🚹','🚺','🚼','🚾','🚰','🚮','🅿','♿','🚭','🈷','🈸','🈂','Ⓜ','🛂','🛄','🛅','🛃','🉑','㊙','㊗','🆑','🆘','🆔','🚫','🔞','📵','🚯','🚱','🚳','🚷','🚸','⛔','✳','❇','❎','✅','✴','💟','🆚','📳','📴','🅰','🅱','🆎','🅾','💠','➿','♻','♈','♉','♊','♋','♌','♍','♎','♏','♐','♑','♒','♓','⛎','🔯','🏧','💹','💲','💱','©','®','™','〽','〰','🔝','🔚','🔙','🔛','🔜','❌','⭕','❗','❓','❕','❔','🔃','🕛','🕧','🕐','🕜','🕑','🕝','🕒','🕞','🕓','🕟','🕔','🕠','🕕','🕖','🕗','🕘','🕙','🕚','🕡','🕢','🕣','🕤','🕥','🕦','✖','➕','➖','➗','♠','♥','♣','♦','💮','💯','✔','☑','🔘','🔗','➰','🔱','🔲','🔳','◼','◻','◾','◽','▪','▫','🔺','⬜','⬛','⚫','⚪','🔴','🔵','🔻','🔶','🔷','🔸','🔹'
  71. ];
  72.  
  73. return emojis[Math.floor(Math.random() * emojis.length)];
  74. }
  75.  
  76. //Output XX/XX/XX @ XX:XX:XX
  77. function getDateTime() {
  78. var currentdate = new Date();
  79.  
  80. if(currentdate.getMinutes() > 9) var fixed_minutes = currentdate.getMinutes();
  81. else var fixed_minutes = "0" + currentdate.getMinutes();
  82. if(currentdate.getSeconds() > 9) var fixed_seconds = currentdate.getSeconds();
  83. else var fixed_seconds = "0" + currentdate.getSeconds();
  84.  
  85. var datetime = currentdate.getDate() + "/" + (currentdate.getMonth()+1) + "/" + currentdate.getFullYear() + " @ " + currentdate.getHours() + ":" + fixed_minutes + ":" + fixed_seconds;
  86.  
  87. return datetime;
  88. }
  89.  
  90. //Output: XX:XX:XX
  91. function getExactTime() {
  92. var currentdate = new Date();
  93.  
  94. if(currentdate.getMinutes() > 9) var fixed_minutes = currentdate.getMinutes();
  95. else var fixed_minutes = "0" + currentdate.getMinutes();
  96. if(currentdate.getSeconds() > 9) var fixed_seconds = currentdate.getSeconds();
  97. else var fixed_seconds = "0" + currentdate.getSeconds();
  98.  
  99. var datetime = currentdate.getHours() + ":" + fixed_minutes + ":" + fixed_seconds;
  100.  
  101. return datetime;
  102. }
  103.  
  104. //Output: XX:XX
  105. function getTime() {
  106. var currentdate = new Date();
  107.  
  108. if(currentdate.getMinutes() > 9) var fixed_minutes = currentdate.getMinutes();
  109. else var fixed_minutes = "0" + currentdate.getMinutes();
  110.  
  111. var datetime = currentdate.getHours() + ":" + fixed_minutes;
  112.  
  113. return datetime;
  114. }
  115.  
  116. //Simple wait function for animation
  117. function wait(t) {
  118. return new Promise(function(resolve) {
  119. setTimeout(resolve, t)
  120. });
  121. }
  122.  
  123. //Typewriter effect
  124. async function typewriter(emoji,text,timeout,reversed) {
  125. //Repeat for each letter
  126. for(var i = 1; i <= text.length; i++) {
  127. //Cut the text
  128. if(!reversed) var substring_text = text.substring(0,i);
  129. else var substring_text = text.substring(0,text.length - i);
  130. //Set the status to the cutted text
  131. if(emoji != "random") await status(emoji,substring_text);
  132. else await status(random_emoji(),substring_text);
  133. //Wait a selected amount of time until writing the next letter
  134. await wait(timeout);
  135. }
  136.  
  137. return;
  138. }
  139.  
  140. //Glitch effect
  141. async function glitch(emoji,text,times,timeout) {
  142. //Repeat for each letter
  143. for(var i = 1; i < times; i++) {
  144. //Shuffle the text
  145. var glitch_text = shuffle(text)
  146. //Set the status to the cutted text
  147. if(emoji != "random") await status(emoji,glitch_text);
  148. else await status(random_emoji(),glitch_text);
  149. //Wait a selected amount of time until writing the next letter
  150. await wait(timeout);
  151. }
  152.  
  153. return;
  154. }
  155.  
  156. //Glitchtype effect
  157. async function glitchtype(emoji,text,timeout,glitch_rate,reversed) {
  158. //Repeat for each letter
  159. for(var i = 1; i <= text.length; i++) {
  160. //Cut the text
  161. if(!reversed) var substring_text = text.substring(0,i);
  162. else var substring_text = text.substring(0,text.length - i);
  163. //Glitch rest of the text
  164. if(!reversed) var glitch_text = shuffle(text.substring(i));
  165. else var glitch_text = shuffle(text.substring(text.length - i));
  166. //Set the status to the cutted text + glitched text
  167. if(emoji != "random") await status(emoji,substring_text + glitch_text);
  168. else await status(random_emoji(),substring_text + glitch_text);
  169. //Wait a selected amount of time until writing the next letter
  170. await wait(timeout);
  171. for(var a = 0; a < glitch_rate; a++) {
  172. //Glitch rest of the text
  173. if(!reversed) var glitch_text = shuffle(text.substring(i));
  174. else var glitch_text = shuffle(text.substring(text.length - i));
  175. //Set the status to the cutted text + glitched text
  176. await status(emoji,substring_text + glitch_text);
  177. //Wait a selected amount of time until writing the next glitched characterset at the end of the string
  178. await wait(timeout/2);
  179. }
  180. }
  181. return;
  182. }
  183.  
  184. //Sentence effect
  185. async function sentence(emoji,text,timeout) {
  186. //Split sentence into words
  187. var words = text.split(" ");
  188.  
  189. //Repeat for each word
  190. for(var i = 0; i < words.length; i++) {
  191. //Set status to array's word
  192. if(emoji != "random") await status(emoji,words[i]);
  193. else await status(random_emoji(),words[i]);
  194. //Wait a selected amount of time until writing the next letter
  195. await wait(timeout);
  196. }
  197. return;
  198. }
  199.  
  200. //Blink effect
  201. async function blink(emoji,text,timeout,times) {
  202. for(var i = 0; i < times; i++) {
  203. if(emoji != "random") await status(emoji,text);
  204. else await status(random_emoji(),text);
  205. await wait(timeout);
  206. await blank();
  207. await wait(timeout);
  208. }
  209.  
  210. return;
  211. }
  212.  
  213. //Clear the status
  214. async function blank() {
  215. //Could just send blank status as {"custom_status":null}, but that behaves weirdly.
  216. await status("","");
  217.  
  218. return;
  219. }
  220.  
  221.  
  222. //Part of the skip function - stackoverflow.com/a/8630472
  223. var store = (function() {
  224. var map = {};
  225.  
  226. return {
  227. set: function ( name, value ) {
  228. map[ name ] = value;
  229. },
  230. get: function ( name ) {
  231. return map[ name ];
  232. }
  233. };
  234. })();
  235.  
  236. //Skip the end of the animation
  237. async function skip(amount,uniquetext) {
  238. var uniqueID = amount + "_" + uniquetext;
  239.  
  240. var set = store.set;
  241. var get = store.get;
  242. var currentamount = get(uniqueID);
  243.  
  244. //Check if there's a variable already
  245. if(currentamount >= 0) {
  246. //If to continue
  247. if(currentamount == amount) {
  248. //Reset the variable
  249. set(uniqueID,0);
  250. //Update the currentamount variable
  251. currentamount = get(uniqueID);
  252. //console.log("id: " + uniqueID + "\n\n value: " + get(uniqueID) + " | result: false\n\n");
  253. return false;
  254. }
  255. //Skip
  256. else {
  257. //Add one to the variable
  258. set(uniqueID,get(uniqueID) + 1);
  259. //Update the currentamount variable
  260. currentamount = get(uniqueID);
  261. //console.log("id: " + uniqueID + "\n\n value: " + get(uniqueID) + " | result: true\n\n");
  262. return true;
  263. }
  264. //If there was no variable made already
  265. } else {
  266. //Make the variable
  267. set(uniqueID,0);
  268. //Add one to it
  269. set(uniqueID,get(uniqueID) + 1);
  270. //Update the currentamount variable
  271. currentamount = get(uniqueID);
  272. //console.log("(FIRST TIME) " + "id: " + uniqueID + "\n\n value: " + get(uniqueID) + " | result: true\n\n");
  273. return true;
  274. }
  275. }
  276.  
  277. //Count effect
  278. async function count(emoji,prefix,count_to,suffix,timeout,reversed) {
  279. for(var i = 0; i < count_to; i++) {
  280. if(!reversed) {
  281. var recalculated_count = i + 1;
  282. var final_string = prefix + recalculated_count + suffix;
  283. }
  284. else {
  285. var recalculated_count = count_to - i;
  286. var final_string = prefix + recalculated_count + suffix;
  287. }
  288. if(emoji != "random") await status(emoji,final_string);
  289. else await status(random_emoji(),final_string);
  290. await wait(timeout);
  291. }
  292. return;
  293. }
  294.  
  295. //Generate random number between min and max
  296. function random_number(min,max) {
  297. return Math.floor(Math.random() * (max - min + 1)) + min;
  298. }
  299.  
  300. //codespeedy.com/shuffle-characters-of-a-string-in-javascript/
  301. function getRandomInt(n) {
  302. return Math.floor(Math.random() * n);
  303. }
  304.  
  305. //codespeedy.com/shuffle-characters-of-a-string-in-javascript/
  306. function shuffle(s) {
  307. var arr = s.split(''); // Convert String to array
  308. var n = arr.length; // Length of the array
  309.  
  310. for(var i=0 ; i<n-1 ; ++i) {
  311. var j = getRandomInt(n); // Get random of [0, n-1]
  312.  
  313. var temp = arr[i]; // Swap arr[i] and arr[j]
  314. arr[i] = arr[j];
  315. arr[j] = temp;
  316. }
  317.  
  318. s = arr.join(''); // Convert Array to string
  319. return s; // Return shuffled string
  320. }
  321.  
  322. //Function to read the saved cookie
  323. window.getCookie = function(name) {
  324. var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
  325. if (match) return match[2];
  326. }
  327.  
  328. //Set the Discord Token as a Cookie for future use of the script
  329. //If there is no Token cookie
  330. if(document.cookie.indexOf(cookie_name + "=") == -1) {
  331. //Ask user if they want to refresh the page to get the token
  332. if(confirm("\"" + cookie_name + "\" cookie not found. Refreshing Discord to get it.\n\n- " + name + " " + version)) {
  333. //Load the page again and create a new element which will have the token in its localStorage
  334. location.reload();
  335. var i = document.createElement('iframe');
  336. document.body.appendChild(i);
  337. //Get Token from localStorage
  338. var token = i.contentWindow.localStorage.token
  339. token = token.slice(1, -1);
  340. //Delete cookie after a week or not
  341. if(delete_cookie_after_a_week)
  342. document.cookie = cookie_name + "=" + token + "; secure=true; max-age=604800; path=/";
  343. else
  344. document.cookie = cookie_name + "=" + token + "; secure=true; path=/";
  345.  
  346. } else throw new Error("[Not an actually uncaught] User stopped the Status Animator. \n\nNo cookie was found and user decided not to continue.");
  347. }
  348.  
  349. var status_text = "";
  350. var status_emoji = "";
  351. var status_state = "";
  352. //Function that changes the status variables (Saves up a bit space)
  353. async function status(emoji,text,state) {
  354. if(run) {
  355. status_text = text;
  356. status_emoji = emoji;
  357. status_state = state;
  358. await setstatus();
  359. return;
  360. }
  361. }
  362.  
  363. //Get Discord Token from saved Cookie
  364. var token = getCookie(cookie_name);
  365.  
  366. //HTTP Request's URL address
  367. var url = "https://discord.com/api/v9/users/@me/settings";
  368.  
  369. //Function that handles the HTTP request for the status change
  370. async function setstatus() {
  371.  
  372. var request = new XMLHttpRequest();
  373. request.open("PATCH", url);
  374. request.setRequestHeader("Accept", "*/*" );
  375. request.setRequestHeader("Content-Type", "application/json");
  376. request.setRequestHeader("Authorization", token);
  377. request.send(JSON.stringify({"custom_status":{"text":status_text,"emoji_name":status_emoji}}));
  378.  
  379. //If the request failed
  380. request.onreadystatechange = () => {
  381. if (request.status != 200) {
  382. run = false;
  383. throw new Error("[Not an actually uncaught] Failed to update status. \n\nThe HTTP request failed. Most likely because the authorization token is incorrect.");
  384. }
  385. };
  386.  
  387. if(status_state == "invisible" || status_state == "dnd" || status_state == "idle" || status_state == "online") {
  388. var request2 = new XMLHttpRequest();
  389. request2.open("PATCH", url);
  390. request2.setRequestHeader("Accept", "*/*" );
  391. request2.setRequestHeader("Content-Type", "application/json");
  392. request2.setRequestHeader("Authorization", token);
  393. request2.send(JSON.stringify({"status":status_state}));
  394. //If the request failed
  395. request2.onreadystatechange = () => {
  396. if (request2.status != 200) {
  397. run = false;
  398. throw new Error("[Not an actually uncaught] Failed to update status. \n\nThe HTTP request failed. Most likely because the authorization token is incorrect.");
  399. }
  400. };
  401. }
  402.  
  403. return;
  404. }
  405.  
  406. async function setstate(text) {
  407. if(run) {
  408. status_state = text;
  409. if(status_state == "invisible" || status_state == "dnd" || status_state == "idle" || status_state == "online") {
  410. var request = new XMLHttpRequest();
  411. request.open("PATCH", url);
  412. request.setRequestHeader("Accept", "*/*" );
  413. request.setRequestHeader("Content-Type", "application/json");
  414. request.setRequestHeader("Authorization", token);
  415. request.send(JSON.stringify({"status":status_state}));
  416. //If the request failed
  417. request.onreadystatechange = () => {
  418. if (request.status != 200) {
  419. run = false;
  420. throw new Error("[Not an actually uncaught] Failed to update state. \n\nThe HTTP request failed. Most likely because the authorization token is incorrect.");
  421. }
  422. };
  423. }
  424.  
  425. return;
  426. }
  427. }
  428.  
  429. async function setemoji(emoji) {
  430. if(run) {
  431. status_emoji = emoji;
  432. var request = new XMLHttpRequest();
  433. request.open("PATCH", url);
  434. request.setRequestHeader("Accept", "*/*" );
  435. request.setRequestHeader("Content-Type", "application/json");
  436. request.setRequestHeader("Authorization", token);
  437. request.send(JSON.stringify({"custom_status":{"emoji_name":status_emoji}}));
  438.  
  439. //If the request failed
  440. request.onreadystatechange = () => {
  441. if (request.status != 200) {
  442. run = false;
  443. throw new Error("[Not an actually uncaught] Failed to update emoji. \n\nThe HTTP request failed. Most likely because the authorization token is incorrect.");
  444. }
  445. };
  446.  
  447. return;
  448. }
  449. }
  450.  
  451. async function settext(text) {
  452. if(run) {
  453. status_text = text;
  454. var request = new XMLHttpRequest();
  455. request.open("PATCH", url);
  456. request.setRequestHeader("Accept", "*/*" );
  457. request.setRequestHeader("Content-Type", "application/json");
  458. request.setRequestHeader("Authorization", token);
  459. request.send(JSON.stringify({"custom_status":{"text":status_text}}));
  460.  
  461. //If the request failed
  462. request.onreadystatechange = () => {
  463. if (request.status != 200) {
  464. run = false;
  465. throw new Error("[Not an actually uncaught] Failed to update text. \n\nThe HTTP request failed. Most likely because the authorization token is incorrect.");
  466. }
  467. };
  468.  
  469. return;
  470. }
  471. }
  472.  
  473. //Loops the animation
  474. async function animation_loop() {
  475. while(run) {
  476. await statusanimation();
  477. }
  478. }
  479.  
  480. //Start the animation loop
  481. animation_loop();
  482.  
  483. //Edit/Clear status before exiting
  484. window.onbeforeunload = function () {
  485. run = false;
  486.  
  487. status_text = default_status_text;
  488. status_emoji = default_status_emoji;
  489.  
  490. if(status_state == "invisible" || status_state == "dnd" || status_state == "idle" || status_state == "online")
  491. status_state = default_status_state;
  492.  
  493. setstatus();
  494.  
  495. return "";
  496. };

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址