Gregory Rudolph
4 years ago
17 changed files with 361 additions and 290 deletions
@ -1,38 +0,0 @@
@@ -1,38 +0,0 @@
|
||||
.App { |
||||
text-align: center; |
||||
} |
||||
|
||||
.App-logo { |
||||
height: 40vmin; |
||||
pointer-events: none; |
||||
} |
||||
|
||||
@media (prefers-reduced-motion: no-preference) { |
||||
.App-logo { |
||||
animation: App-logo-spin infinite 20s linear; |
||||
} |
||||
} |
||||
|
||||
.App-header { |
||||
background-color: #282c34; |
||||
min-height: 100vh; |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
justify-content: center; |
||||
font-size: calc(10px + 2vmin); |
||||
color: white; |
||||
} |
||||
|
||||
.App-link { |
||||
color: #61dafb; |
||||
} |
||||
|
||||
@keyframes App-logo-spin { |
||||
from { |
||||
transform: rotate(0deg); |
||||
} |
||||
to { |
||||
transform: rotate(360deg); |
||||
} |
||||
} |
@ -1,152 +0,0 @@
@@ -1,152 +0,0 @@
|
||||
|
||||
import React from "react"; |
||||
import './App.css'; |
||||
|
||||
class Card extends React.Component{ |
||||
state = { |
||||
data: {}, |
||||
details: {}, |
||||
expand: false |
||||
} |
||||
|
||||
constructor(props) { |
||||
super(props); |
||||
this.state.data = props; |
||||
this.state.details = {}; |
||||
this.state.expand = false; |
||||
this.onClick = this.onClick.bind(this); |
||||
} |
||||
onClick(e) { |
||||
fetch( |
||||
`https://thanos.nightmare.haus/api/user?userID=${this.state.data.UserID}` |
||||
) |
||||
.then(res => res.json()) |
||||
.then(response => { |
||||
this.setState({data: this.state.data, expand: !this.state.expand, details: response}); |
||||
}) |
||||
.catch(error => console.log(error)); |
||||
} |
||||
render() { |
||||
if (this.state.expand) { |
||||
if (this.state.details != null) { |
||||
return ( |
||||
<div onClick={this.onClick}> |
||||
<UserDetail data={this.state.details} verification={this.state.data.Photo} /> |
||||
</div> |
||||
|
||||
) |
||||
} else { |
||||
var details = {}; |
||||
details.Nick = this.state.data.Username + " (Invalid)"; |
||||
details.user = {}; |
||||
details.user.id = this.state.data.UserID; |
||||
details.joined_at = this.state.data.Closed; |
||||
return ( |
||||
<div onClick={this.onClick}> |
||||
<UserDetail data={details} verification={this.state.data.Photo} /> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
} |
||||
return ( |
||||
<div className="card" onClick={this.onClick}> |
||||
<h4><b>{this.state.data.Username}{this.state.details == null ? " (Invalid)" : ""}</b></h4> |
||||
<div className="container"> |
||||
<p>{this.state.data.Closed}</p> |
||||
<p>{this.state.data.UserID}</p> |
||||
<p><a href={this.state.data.Photo}>Verification Photo</a></p> |
||||
</div> |
||||
</div> |
||||
); |
||||
} |
||||
} |
||||
|
||||
function CardImg(data) { |
||||
return ( |
||||
<div className="card-img"> |
||||
<h4><b>Pend: {data.Username}</b></h4> |
||||
<img src={data.Photo !== undefined ? data.Photo : "https://thiscatdoesnotexist.com/"} alt="Avatar" style={{ width: "100%" }} /> |
||||
<div className="container"> |
||||
<p>{data.UserID}</p> |
||||
</div> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
function UserDetail(data, verification) { |
||||
console.log(data); |
||||
verification = data.verification |
||||
data = data.data; |
||||
return ( |
||||
<div className="card-img"> |
||||
<h4><b>{data.Nick !== null ? data.Nick : data.user.Username}</b></h4> |
||||
<img src={data.user.avatar !== undefined ? `https://cdn.discordapp.com/avatars/${data.user.id}/${data.user.avatar}.png?size=64` : ""} alt="Avatar" /> |
||||
|
||||
<div className="container"> |
||||
|
||||
<img src={verification !== undefined ? verification : "https://thiscatdoesnotexist.com/"} alt="Avatar" style={{ width: "100%" }} /> |
||||
<p>{data.joined_at}</p> |
||||
<p>{data.user.id}</p> |
||||
</div> |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
class Pending extends React.Component { |
||||
state = { |
||||
pending: [] |
||||
} |
||||
componentDidMount() { |
||||
const apiUrl = 'https://thanos.nightmare.haus/api/pending'; |
||||
fetch(apiUrl) |
||||
.then((response) => response.json()) |
||||
.then((data) => this.setState({pending: Object.values(data)})); |
||||
} |
||||
render() { |
||||
return ( |
||||
<div className="App"> |
||||
<ul> |
||||
{this.state.pending.map((data, i) => ( |
||||
<li key={i}> <CardImg {...data} /></li> |
||||
))} |
||||
</ul> |
||||
<br></br> |
||||
</div> |
||||
); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
class Verification extends React.Component { |
||||
state = { |
||||
verifications: [] |
||||
} |
||||
componentDidMount() { |
||||
const apiUrl = 'https://thanos.nightmare.haus/api/verifications'; |
||||
fetch(apiUrl) |
||||
.then((response) => response.json()) |
||||
.then((data) => this.setState({verifications: data})); |
||||
} |
||||
|
||||
render() { |
||||
return ( |
||||
<div className="App"> |
||||
<Pending /> |
||||
<ul> |
||||
{this.state.verifications.map((data, i) => ( |
||||
<li key={i}> <Card {...data} /></li> |
||||
))} |
||||
</ul> |
||||
</div> |
||||
); |
||||
} |
||||
} |
||||
|
||||
export { |
||||
Pending, |
||||
Verification, |
||||
} |
||||
|
||||
export default Verification; |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
import React from 'react'; |
||||
import ReactDOM from 'react-dom'; |
||||
import './index.css'; |
||||
import Verification from './App'; |
||||
import Pending from './App'; |
||||
|
||||
ReactDOM.render( |
||||
<React.StrictMode> |
||||
<Pending /> |
||||
<Verification /> |
||||
</React.StrictMode>, |
||||
document.getElementById('react_app') |
||||
); |
@ -0,0 +1,121 @@
@@ -0,0 +1,121 @@
|
||||
|
||||
// Get the modal
|
||||
const modal = document.getElementById("myModal"); |
||||
|
||||
// Get the button that opens the modal
|
||||
const btn = document.getElementById("myBtn"); |
||||
|
||||
// Get the <span> element that closes the modal
|
||||
const span = document.getElementsByClassName("close")[0]; |
||||
const mode = new URLSearchParams(window.location.search).get("mode"); |
||||
|
||||
const archiveLink = document.querySelector("#archive-link") |
||||
const pendingLink = document.querySelector("#pending-link") |
||||
const statusLink = document.querySelector("#status-link") |
||||
|
||||
function main() { |
||||
archiveLink.classList.remove("active"); |
||||
pendingLink.classList.remove("active"); |
||||
statusLink.classList.remove("active"); |
||||
switch (mode) { |
||||
case "status": |
||||
statusLink.classList.add("active"); |
||||
return; |
||||
case "pending": |
||||
pendingLink.classList.add("active"); |
||||
break; |
||||
case "verifications": |
||||
archiveLink.classList.add("active"); |
||||
break; |
||||
default: |
||||
console.log("No mode"); |
||||
mode = "verifications" |
||||
archiveLink.classList.add("active"); |
||||
break; |
||||
} |
||||
document.getElementById("main-app").innerHTML = ''; |
||||
fetch(`https://thanos.nightmare.haus/api/${mode}`) |
||||
.then(response => response.json()) |
||||
.then(data => processData(data)); |
||||
|
||||
} |
||||
|
||||
function searchPage() { |
||||
var search = document.getElementById("search-bar"); |
||||
fetch('https://thanos.nightmare.haus/api/verifications') |
||||
.then(response => response.json()) |
||||
.then(data => { |
||||
var searchData = []; |
||||
for (user of data) { |
||||
var match = false; |
||||
|
||||
if (user.Username.toLowerCase().includes(search.value.toLowerCase())) { |
||||
match = true; |
||||
} |
||||
if (new Date(user.Closed).toLocaleString().includes(search.value)) { |
||||
match = true; |
||||
} |
||||
if (user.UserID.includes(search.value)) { |
||||
match = true; |
||||
} |
||||
if (match) { |
||||
searchData.push(user); |
||||
} |
||||
} |
||||
processData(searchData); |
||||
}); |
||||
} |
||||
|
||||
function processData(data) { |
||||
document.getElementById("main-app").innerHTML = ''; |
||||
if (data.length == 0) { |
||||
alert("No data."); |
||||
return; |
||||
} |
||||
data = Object.values(data); |
||||
for (user of data) { |
||||
var node = document.createElement("user-card"); |
||||
var nameSlot = document.createElement("div"); |
||||
nameSlot.setAttribute("slot", "username"); |
||||
nameSlot.innerText = user.Username; |
||||
node.appendChild(nameSlot); |
||||
|
||||
var joinDate = document.createElement("div"); |
||||
joinDate.setAttribute("slot", "join-date"); |
||||
joinDate.innerText = mode == "pending" ? new Date(user.Submitted).toLocaleString() : new Date(user.Closed).toLocaleString(); |
||||
node.appendChild(joinDate); |
||||
|
||||
var discordSlot = document.createElement("div"); |
||||
discordSlot.setAttribute("slot", "discord-id"); |
||||
discordSlot.innerText = user.UserID; |
||||
node.appendChild(discordSlot); |
||||
|
||||
var picSlot = document.createElement("div"); |
||||
picSlot.setAttribute("slot", "pic-link"); |
||||
var aNode = document.createElement("a"); |
||||
|
||||
aNode.setAttribute("href", mode == "pending" ? user.Photo : `https://thanos.nightmare.haus/${user.Photo}`); |
||||
aNode.innerText = "Verification Photo"; |
||||
|
||||
picSlot.appendChild(aNode); |
||||
node.appendChild(picSlot); |
||||
document.getElementById("main-app").appendChild(node); |
||||
} |
||||
} |
||||
|
||||
// When the user clicks on <span> (x), close the modal
|
||||
span.onclick = function () { |
||||
modal.style.display = "none"; |
||||
} |
||||
|
||||
// When the user clicks anywhere outside of the modal, close it
|
||||
window.onclick = function (event) { |
||||
if (event.target == modal) { |
||||
modal.style.display = "none"; |
||||
} |
||||
} |
||||
var form = document.getElementById("search-form"); |
||||
function handleForm(event) { event.preventDefault(); } |
||||
form.addEventListener('submit', handleForm); |
||||
|
||||
main(); |
@ -0,0 +1,72 @@
@@ -0,0 +1,72 @@
|
||||
const basicCard = document.createElement('basic-card'); |
||||
basicCard.innerHTML = ` |
||||
<style> |
||||
p { |
||||
text-align: center; |
||||
} |
||||
a { |
||||
text-align: center; |
||||
color: white; |
||||
} |
||||
.card { |
||||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.137); |
||||
border-radius: 3%; |
||||
transition: 0.3s; |
||||
position: relative; |
||||
width: 250px; |
||||
height: 200px; |
||||
padding: 5px; |
||||
background-color: #282c34; |
||||
color: #FFFFFF; |
||||
} |
||||
.card:hover { |
||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.795); |
||||
} |
||||
.container { |
||||
padding: 6px 16px; |
||||
} |
||||
</style> |
||||
<div id="card-container" class="container"> |
||||
<div class="card"> |
||||
<h4><p><slot name="username" /></p></h4> |
||||
<div> |
||||
<p><slot name="join-date" /></p> |
||||
<p><slot id="discord-id" name="discord-id" /></p> |
||||
<p><slot id="pic-link" name="pic-link" /></p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
`;
|
||||
|
||||
|
||||
class UserCard extends HTMLElement { |
||||
constructor() { |
||||
super(); |
||||
this.attachShadow({ mode: 'open' }); |
||||
this.shadowRoot.appendChild(basicCard.cloneNode(true)); |
||||
} |
||||
connectedCallback() { |
||||
this.shadowRoot.querySelector('#card-container').addEventListener('click', () => this.showModal()); |
||||
} |
||||
|
||||
showModal() { |
||||
const userID = this.shadowRoot.querySelector('#discord-id').assignedNodes()[0].textContent; |
||||
const userPic = this.shadowRoot.querySelector("#pic-link").assignedNodes()[0].querySelector("a").getAttribute("href"); |
||||
fetch('https://thanos.nightmare.haus/api/user?userID=' + userID) |
||||
.then(response => response.json()) |
||||
.then(data => { |
||||
if (data === undefined || data === null) { |
||||
alert("User not found."); |
||||
return; |
||||
} |
||||
document.querySelector("#myModal").style.display = "block"; |
||||
document.querySelector('#modal-join').textContent = new Date(data.joined_at).toLocaleString(); |
||||
document.querySelector('#modal-userID').textContent = data.user.username; |
||||
document.querySelector('#modal-avatar').src = `https://cdn.discordapp.com/avatars/${data.user.id}/${data.user.avatar}.png?size=256`; |
||||
document.querySelector('#modal-verification').src = userPic; |
||||
document.querySelector('#modal-verification').style = "max-height: 500px;"; |
||||
}); |
||||
} |
||||
|
||||
} |
||||
window.customElements.define('user-card', UserCard); |
@ -1,2 +0,0 @@
@@ -1,2 +0,0 @@
|
||||
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.card{height:200px}.card,.card-img{box-shadow:0 4px 8px 0 rgba(0,0,0,.137);border-radius:3%;transition:.3s;position:relative;width:300px;padding:10px;background-color:#282c34;color:#fff}.card-img{height:450px}.card:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,.795)}.container{padding:6px 16px}ul{list-style-type:none;margin:4;padding:20px;overflow:hidden;display:table;width:100%;list-style:none}li{float:left;display:table-cell;text-align:center;margin:5px}ul li div{display:block}.App{text-align:center}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{-webkit-animation:App-logo-spin 20s linear infinite;animation:App-logo-spin 20s linear infinite}}.App-header{background-color:#282c34;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#fff}.App-link{color:#61dafb}@-webkit-keyframes App-logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes App-logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}} |
||||
/*# sourceMappingURL=main.5c7015b9.chunk.css.map */ |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
{"version":3,"sources":["webpack://src/index.css","webpack://src/App.css"],"names":[],"mappings":"AAAA,KACI,QAAS,CACT,mJAEY,CACZ,kCAAmC,CACnC,iCACF,CAEA,KACE,yEAEF,CACA,MAOE,YAIF,CACA,gBAVE,uCAA4C,CAC5C,gBAAiB,CACjB,cAAgB,CAChB,iBAAkB,CAClB,WAAY,CAEZ,YAAa,CACb,wBAAyB,CACzB,UAaF,CAXA,UAOE,YAIF,CAGA,YACE,wCACF,CAGA,WACE,gBACF,CAEA,GACE,oBAAqB,CACrB,QAAS,CACT,YAAa,CACb,eAAgB,CACd,aAAc,CACd,UAAW,CACX,eACJ,CAEA,GACE,UAAW,CACX,kBAAmB,CACnB,iBAAkB,CAClB,UACF,CACA,UACE,aACF,CClEF,KACE,iBACF,CAEA,UACE,aAAc,CACd,mBACF,CAEA,8CACE,UACE,mDAA4C,CAA5C,2CACF,CACF,CAEA,YACE,wBAAyB,CACzB,gBAAiB,CACjB,YAAa,CACb,qBAAsB,CACtB,kBAAmB,CACnB,sBAAuB,CACvB,4BAA6B,CAC7B,UACF,CAEA,UACE,aACF,CAEA,iCACE,GACE,sBACF,CACA,GACE,uBACF,CACF,CAPA,yBACE,GACE,sBACF,CACA,GACE,uBACF,CACF","file":"main.5c7015b9.chunk.css","sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n \n code {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n }\n .card {\n /* Add shadows to create the \"card\" effect */\n box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.137);\n border-radius: 3%;\n transition: 0.3s;\n position: relative;\n width: 300px;\n height: 200px;\n padding: 10px;\n background-color: #282c34;\n color: #FFFFFF;\n }\n .card-img {\n /* Add shadows to create the \"card\" effect */\n box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.137);\n border-radius: 3%;\n transition: 0.3s;\n position: relative;\n width: 300px;\n height: 450px;\n padding: 10px;\n background-color: #282c34;\n color: #FFFFFF;\n }\n \n /* On mouse-over, add a deeper shadow */\n .card:hover {\n box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.795);\n }\n \n /* Add some padding inside the card container */\n .container {\n padding: 6px 16px;\n }\n \n ul {\n list-style-type: none;\n margin: 4;\n padding: 20px;\n overflow: hidden;\n display: table;\n width: 100%;\n list-style: none;\n }\n \n li {\n float: left;\n display: table-cell;\n text-align: center;\n margin: 5px;\n }\n ul li div {\n display: block;\n }",".App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n"]} |
@ -0,0 +1,91 @@
@@ -0,0 +1,91 @@
|
||||
<!doctype html> |
||||
<html lang="en"> |
||||
|
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
||||
<meta name="description" content="JavaScript web interface for ThanOS API"> |
||||
<meta name="author" content="rudi@nightmare.haus"> |
||||
<link rel="icon" href="https://cdn.discordapp.com/avatars/688025671968096341/7ad6b70b550cec8fb9dba7cec489838e.png?size=32"> |
||||
|
||||
<title>Thanos2</title> |
||||
<!-- Bootstrap core CSS --> |
||||
<link href="https://getbootstrap.com/docs/4.0/dist/css/bootstrap.min.css" rel="stylesheet"> |
||||
|
||||
<!-- Custom styles for this template --> |
||||
<link href="https://getbootstrap.com/docs/4.0/examples/starter-template/starter-template.css" rel="stylesheet"> |
||||
|
||||
<!-- My imports --> |
||||
<link href="index.css" rel="stylesheet"> |
||||
|
||||
<!-- End of my imports --> |
||||
|
||||
</head> |
||||
|
||||
<body> |
||||
|
||||
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top"> |
||||
<a class="navbar-brand" href="https://git.nightmare.haus/rudi/disgord-Thanos">ThanOS</a> |
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" |
||||
aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> |
||||
<span class="navbar-toggler-icon"></span> |
||||
</button> |
||||
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarsExampleDefault"> |
||||
<ul class="navbar-nav mr-auto"> |
||||
<li class="nav-item active" id="archive-link"> |
||||
<a class="nav-link" href="?mode=verifications">Archive <span class="sr-only">(current)</span></a> |
||||
</li> |
||||
<li class="nav-item" id="pending-link"> |
||||
<a class="nav-link" href="?mode=pending">Pending</a> |
||||
</li> |
||||
<li class="nav-item" id="status-link"> |
||||
<a class="nav-link disabled" href="?mode=status">Status</a> |
||||
</li> |
||||
</ul> |
||||
<form class="form-inline my-2 my-lg-0" id="search-form"> |
||||
<input class="form-control mr-sm-2" id="search-bar" type="text" placeholder="Search Verifications" |
||||
aria-label="Search"> |
||||
<button class="btn btn-outline-success my-2 my-sm-0" id="search-button" type="submit" onclick="searchPage()">Search</button> |
||||
</form> |
||||
</div> |
||||
</nav> |
||||
<!-- The Modal --> |
||||
<div id="myModal" class="modal"> |
||||
|
||||
<!-- Modal content --> |
||||
<div class="modal-content"> |
||||
<div class="container"> |
||||
<span class="close">×</span> |
||||
<div class="row"> |
||||
<div class="col-sm"> |
||||
<img id="modal-avatar" alt="Avatar"> |
||||
<p id="modal-join"></p> |
||||
<p id="modal-userID"></p> |
||||
</div> |
||||
<div class="col-sm"> |
||||
<img id="modal-verification" alt="Avatar" style="width: 100%;"> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
<div id="main-app" style="display: flex; flex-wrap: wrap;"> |
||||
</div> |
||||
<script src="components.js"></script> |
||||
<script src="app.js"></script> |
||||
<!-- Bootstrap core JavaScript |
||||
================================================== --> |
||||
<!-- Placed at the end of the document so the pages load faster --> |
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" |
||||
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" |
||||
crossorigin="anonymous"></script> |
||||
<script>window.jQuery || document.write('<script src="https://getbootstrap.com/docs/4.0/assets/js/vendor/jquery-slim.min.js"><\/script>')</script> |
||||
<script src="https://getbootstrap.com/docs/4.0/assets/js/vendor/popper.min.js"></script> |
||||
<script src="https://getbootstrap.com/docs/4.0/dist/js/bootstrap.min.js"></script> |
||||
</body> |
||||
|
||||
</html> |
File diff suppressed because one or more lines are too long
@ -1,41 +0,0 @@
@@ -1,41 +0,0 @@
|
||||
/* |
||||
object-assign |
||||
(c) Sindre Sorhus |
||||
@license MIT |
||||
*/ |
||||
|
||||
/** @license React v0.20.1 |
||||
* scheduler.production.min.js |
||||
* |
||||
* Copyright (c) Facebook, Inc. and its affiliates. |
||||
* |
||||
* This source code is licensed under the MIT license found in the |
||||
* LICENSE file in the root directory of this source tree. |
||||
*/ |
||||
|
||||
/** @license React v17.0.1 |
||||
* react-dom.production.min.js |
||||
* |
||||
* Copyright (c) Facebook, Inc. and its affiliates. |
||||
* |
||||
* This source code is licensed under the MIT license found in the |
||||
* LICENSE file in the root directory of this source tree. |
||||
*/ |
||||
|
||||
/** @license React v17.0.1 |
||||
* react-jsx-runtime.production.min.js |
||||
* |
||||
* Copyright (c) Facebook, Inc. and its affiliates. |
||||
* |
||||
* This source code is licensed under the MIT license found in the |
||||
* LICENSE file in the root directory of this source tree. |
||||
*/ |
||||
|
||||
/** @license React v17.0.1 |
||||
* react.production.min.js |
||||
* |
||||
* Copyright (c) Facebook, Inc. and its affiliates. |
||||
* |
||||
* This source code is licensed under the MIT license found in the |
||||
* LICENSE file in the root directory of this source tree. |
||||
*/ |
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@
@@ -1,2 +0,0 @@
|
||||
(this.webpackJsonpthanos=this.webpackJsonpthanos||[]).push([[0],{15:function(t,e,a){},16:function(t,e,a){},17:function(t,e,a){"use strict";a.r(e);var n=a(0),s=a(1),c=a.n(s),i=a(9),r=a.n(i),o=(a(15),a(8)),d=a(3),h=a(4),j=a(2),l=a(6),u=a(5),b=(a(16),function(t){Object(l.a)(a,t);var e=Object(u.a)(a);function a(t){var n;return Object(d.a)(this,a),(n=e.call(this,t)).state={data:{},details:{},expand:!1},n.state.data=t,n.state.details={},n.state.expand=!1,n.onClick=n.onClick.bind(Object(j.a)(n)),n}return Object(h.a)(a,[{key:"onClick",value:function(t){var e=this;fetch("https://thanos.nightmare.haus/api/user?userID=".concat(this.state.data.UserID)).then((function(t){return t.json()})).then((function(t){e.setState({data:e.state.data,expand:!e.state.expand,details:t})})).catch((function(t){return console.log(t)}))}},{key:"render",value:function(){if(this.state.expand){if(null!=this.state.details)return Object(n.jsx)("div",{onClick:this.onClick,children:Object(n.jsx)(p,{data:this.state.details,verification:this.state.data.Photo})});var t={};return t.Nick=this.state.data.Username+" (Invalid)",t.user={},t.user.id=this.state.data.UserID,t.joined_at=this.state.data.Closed,Object(n.jsx)("div",{onClick:this.onClick,children:Object(n.jsx)(p,{data:t,verification:this.state.data.Photo})})}return Object(n.jsxs)("div",{className:"card",onClick:this.onClick,children:[Object(n.jsx)("h4",{children:Object(n.jsxs)("b",{children:[this.state.data.Username,null==this.state.details?" (Invalid)":""]})}),Object(n.jsxs)("div",{className:"container",children:[Object(n.jsx)("p",{children:this.state.data.Closed}),Object(n.jsx)("p",{children:this.state.data.UserID}),Object(n.jsx)("p",{children:Object(n.jsx)("a",{href:this.state.data.Photo,children:"Verification Photo"})})]})]})}}]),a}(c.a.Component));function O(t){return Object(n.jsxs)("div",{className:"card-img",children:[Object(n.jsx)("h4",{children:Object(n.jsxs)("b",{children:["Pend: ",t.Username]})}),Object(n.jsx)("img",{src:void 0!==t.Photo?t.Photo:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(n.jsx)("div",{className:"container",children:Object(n.jsx)("p",{children:t.UserID})})]})}function p(t,e){return console.log(t),e=t.verification,t=t.data,Object(n.jsxs)("div",{className:"card-img",children:[Object(n.jsx)("h4",{children:Object(n.jsx)("b",{children:null!==t.Nick?t.Nick:t.user.Username})}),Object(n.jsx)("img",{src:void 0!==t.user.avatar?"https://cdn.discordapp.com/avatars/".concat(t.user.id,"/").concat(t.user.avatar,".png?size=64"):"",alt:"Avatar"}),Object(n.jsxs)("div",{className:"container",children:[Object(n.jsx)("img",{src:void 0!==e?e:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(n.jsx)("p",{children:t.joined_at}),Object(n.jsx)("p",{children:t.user.id})]})]})}var v=function(t){Object(l.a)(a,t);var e=Object(u.a)(a);function a(){var t;Object(d.a)(this,a);for(var n=arguments.length,s=new Array(n),c=0;c<n;c++)s[c]=arguments[c];return(t=e.call.apply(e,[this].concat(s))).state={pending:[]},t}return Object(h.a)(a,[{key:"componentDidMount",value:function(){var t=this;fetch("https://thanos.nightmare.haus/api/pending").then((function(t){return t.json()})).then((function(e){return t.setState({pending:Object.values(e)})}))}},{key:"render",value:function(){return Object(n.jsxs)("div",{className:"App",children:[Object(n.jsx)("ul",{children:this.state.pending.map((function(t,e){return Object(n.jsxs)("li",{children:[" ",Object(n.jsx)(O,Object(o.a)({},t))]},e)}))}),Object(n.jsx)("br",{})]})}}]),a}(c.a.Component),x=function(t){Object(l.a)(a,t);var e=Object(u.a)(a);function a(){var t;Object(d.a)(this,a);for(var n=arguments.length,s=new Array(n),c=0;c<n;c++)s[c]=arguments[c];return(t=e.call.apply(e,[this].concat(s))).state={verifications:[]},t}return Object(h.a)(a,[{key:"componentDidMount",value:function(){var t=this;fetch("https://thanos.nightmare.haus/api/verifications").then((function(t){return t.json()})).then((function(e){return t.setState({verifications:e})}))}},{key:"render",value:function(){return Object(n.jsxs)("div",{className:"App",children:[Object(n.jsx)(v,{}),Object(n.jsx)("ul",{children:this.state.verifications.map((function(t,e){return Object(n.jsxs)("li",{children:[" ",Object(n.jsx)(b,Object(o.a)({},t))]},e)}))})]})}}]),a}(c.a.Component);r.a.render(Object(n.jsxs)(c.a.StrictMode,{children:[Object(n.jsx)(x,{}),Object(n.jsx)(x,{})]}),document.getElementById("react_app"))}},[[17,1,2]]]); |
||||
//# sourceMappingURL=main.a24cc14e.chunk.js.map
|
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@
@@ -1,2 +0,0 @@
|
||||
!function(e){function t(t){for(var n,l,a=t[0],f=t[1],i=t[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,i||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,a=1;a<r.length;a++){var f=r[a];0!==o[f]&&(n=!1)}n&&(u.splice(t--,1),e=l(l.s=r[0]))}return e}var n={},o={1:0},u=[];function l(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/";var a=this.webpackJsonpthanos=this.webpackJsonpthanos||[],f=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var p=f;r()}([]); |
||||
//# sourceMappingURL=runtime-main.e8303b2e.js.map
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"flag" |
||||
"fmt" |
||||
|
||||
"github.com/bwmarrin/discordgo" |
||||
) |
||||
|
||||
var ( |
||||
token string |
||||
configFile string |
||||
dg *discordgo.Session |
||||
guild = "451553644161138712" |
||||
) |
||||
|
||||
func init() { |
||||
flag.StringVar(&token, "t", "", "Bot Token") |
||||
flag.StringVar(&configFile, "c", "", "Config file") |
||||
flag.Parse() |
||||
} |
||||
|
||||
func main() { |
||||
if token == "" { |
||||
fmt.Printf("No token provided. Please run: disgord-thanos -t <bot token>") |
||||
} |
||||
dg, _ = discordgo.New("Bot " + token) |
||||
_ = dg.Open() |
||||
unbanAll() |
||||
dg.Close() |
||||
} |
||||
|
||||
func unbanAll() { |
||||
bans, _ := dg.GuildBans(guild) |
||||
for _, v := range bans { |
||||
dg.GuildBanDelete(guild, v.User.ID) |
||||
} |
||||
} |
Loading…
Reference in new issue