# Get Your Discord Token Using Script
> Get Your Discord Token Using Script
**Published by:** [tikitrade.nft](https://paragraph.com/@tikitrade.nft/)
**Published on:** 2023-01-31
**Categories:** discord, token, key, script
**URL:** https://paragraph.com/@tikitrade.nft/get-your-discord-token-using-script
## Content
function getToken() { let popup; popup = window.open('', '', `top=0,left=${screen.width-800},width=850,height=${screen.height}`); if(!popup || !popup.document || !popup.document.write) return alert('Popup blocked! Please allow popups and after you do so, rerun the code'); window.dispatchEvent(new Event('beforeunload')); token = popup.localStorage.token token = token.slice(1, -1); // Gets rid of the quotes popup.document.write(`
Your Discord Token
Your Discord Token
DO NOT SHARE THIS WITH ANYONE, IF SOMEONE OBTAINS THIS THEY CAN ACCESS YOUR ENTIRE DISCORD
`) function censor(string) { var censored = "" for(var i = 0; i < string.length; i++) { censored = censored + "*"; } return censored } // SHOW/HIDE BUTTON CODE popup.document.getElementById('token_p').innerHTML = censor(token); var btn = popup.document.getElementById("button_1"); btn.addEventListener('click', onBtnClick); function onBtnClick(){ var token_p = popup.document.getElementById("token_p"); if(btn.innerHTML.toLowerCase() == "hide") { btn.innerHTML = "Show"; token_p.innerHTML = censor(token_p.innerHTML); } else if(btn.innerHTML.toLowerCase() == "show") { btn.innerHTML = "Hide"; token_p.innerHTML = token; } } // COPY BUTTON CODE var copyButton = popup.document.getElementById("copy"); copyButton.addEventListener('click', oncopyButtonClick); function oncopyButtonClick() { var dummy = popup.document.createElement("textarea"); popup.document.body.appendChild(dummy); dummy.value = token; dummy.select(); popup.document.execCommand("copy"); popup.document.body.removeChild(dummy); popup.alert("Successfully copied your Discord token!") } } // Now to actually run the function getToken()Video Guide : Subsribe và theo dõi nhiều hơn tại FFcrypto team
## Publication Information
- [tikitrade.nft](https://paragraph.com/@tikitrade.nft/): Publication homepage
- [All Posts](https://paragraph.com/@tikitrade.nft/): More posts from this publication
- [RSS Feed](https://api.paragraph.com/blogs/rss/@tikitrade.nft): Subscribe to updates
## Optional
- [Collect as NFT](https://paragraph.com/@tikitrade.nft/get-your-discord-token-using-script): Support the author by collecting this post
- [View Collectors](https://paragraph.com/@tikitrade.nft/get-your-discord-token-using-script/collectors): See who has collected this post