Domain change removed the www

This commit is contained in:
ION606
2022-12-24 09:24:24 -08:00
parent 55e7c73a31
commit 3e5202f5b2
11 changed files with 48 additions and 39 deletions
+2 -1
View File
@@ -3,4 +3,5 @@ config.json
node_modules
index - old.html
makefile
temp.html
temp.html
webhook.html
+3 -3
View File
@@ -107,7 +107,7 @@
if (inp.inp == 'cal') {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.open('post', 'https://selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
@@ -121,7 +121,7 @@
//Send the data to the server
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/sendData/', true);
xhr.open('post', 'https://selmerbot.com/sendData/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader(`reminders`, true);
xhr.setRequestHeader(`delObjKeys`, delObjKeys);
@@ -140,7 +140,7 @@
async function createCalEvent(day) {
// event.preventDefault();
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/newCalEvent','newCalPopWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
await new Promise((res, rej) => { res(window.open('https://selmerbot.com/newCalEvent','newCalPopWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { alert("Your browser has JavaScript Disabled!"); return w.close(); }
+6 -6
View File
@@ -30,7 +30,7 @@
async function openNewCalWindow(evjs, day) {
const ev = JSON.parse(evjs);
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/calEvent','popUpWindow','loaction=no,width=600,height=300,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
await new Promise((res, rej) => { res(window.open('https://selmerbot.com/calEvent','popUpWindow','loaction=no,width=600,height=300,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { w.close(); return alert("Your browser has JavaScript Disabled!"); }
@@ -45,7 +45,7 @@
async function createCalEvent(day) {
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/newCalEvent','popUpWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
await new Promise((res, rej) => { res(window.open('https://selmerbot.com/newCalEvent','popUpWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { w.close(); return alert("Your browser has JavaScript Disabled!"); }
@@ -134,7 +134,7 @@
function getSessionData() {
return new Promise((resolve, reject) => {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.open('post', 'https://selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
@@ -156,7 +156,7 @@
if (window.location.href.indexOf('localhost') != -1) {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=token&scope=identify%20guilds';
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmerbot.com%2F&response_type=token&scope=identify%20guilds';
}
}
@@ -167,7 +167,7 @@
const id = sessionInfo.userId;
//Check if the user has premium
var xhrverify = new XMLHttpRequest();
xhrverify.open('post', 'https://www.selmerbot.com/verifypremium/', true);
xhrverify.open('post', 'https://selmerbot.com/verifypremium/', true);
xhrverify.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//Use the guild Id as the userId
@@ -179,7 +179,7 @@
}
var xhr2 = new XMLHttpRequest();
xhr2.open('get', 'https://www.selmerbot.com/getCal/', true);
xhr2.open('get', 'https://selmerbot.com/getCal/', true);
xhr2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//Use the guild Id as the userId
+10 -10
View File
@@ -27,7 +27,7 @@
async function openNewCalWindow(evjs, day) {
const ev = JSON.parse(evjs);
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/calEvent','popUpWindow','loaction=no,width=600,height=300,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
await new Promise((res, rej) => { res(window.open('https://selmerbot.com/calEvent','popUpWindow','loaction=no,width=600,height=300,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { w.close(); return alert("Your browser has JavaScript Disabled!"); }
@@ -45,7 +45,7 @@
async function createCalEvent(day) {
await new Promise((res, rej) => { res(window.open('https://www.selmerbot.com/newCalEvent','popUpWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
await new Promise((res, rej) => { res(window.open('https://selmerbot.com/newCalEvent','popUpWindow','loaction=no,width=400,height=350,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')); })
.then((w) => {
if (!w) { w.close(); return alert("Your browser has JavaScript Disabled!"); }
@@ -133,7 +133,7 @@
function getSessionData() {
return new Promise((resolve, reject) => {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.open('post', 'https://selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
@@ -158,7 +158,7 @@
if (window.location.href.indexOf('localhost') != -1) {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=code&scope=identify%20guilds';
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmerbot.com%2F&response_type=code&scope=identify%20guilds';
}
}
@@ -167,7 +167,7 @@
//Check if the user has premium
var xhrverify = new XMLHttpRequest();
xhrverify.open('post', 'https://www.selmerbot.com/verifypremium/', true);
xhrverify.open('post', 'https://selmerbot.com/verifypremium/', true);
xhrverify.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//Use the guild Id as the userId
@@ -176,7 +176,7 @@
// //Load the channels
// var xhr = new XMLHttpRequest();
// xhr.open('get', `https://www.selmerbot.com/getChannels/`, true);
// xhr.open('get', `https://selmerbot.com/getChannels/`, true);
// xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
// xhr.setRequestHeader('serverNumber', id);
// xhr.onloadend = (e) => {
@@ -277,7 +277,7 @@
var xhr2 = new XMLHttpRequest();
xhr2.open('get', 'https://www.selmerbot.com/getCal/', true);
xhr2.open('get', 'https://selmerbot.com/getCal/', true);
xhr2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr2.setRequestHeader('guildId', id);
@@ -322,7 +322,7 @@
function logout() {
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/logout/', true);
xhr.open('post', 'https://selmerbot.com/logout/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionid', window.localStorage.getItem('sessionId'));
@@ -403,7 +403,7 @@
//Send the data to the server
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/sendData/', true);
xhr.open('post', 'https://selmerbot.com/sendData/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverSettings', JSON.stringify(serverSettings));
@@ -411,7 +411,7 @@
if (xhr.response == 'DONE') {
//Change the current server data
var xhrs = new XMLHttpRequest();
xhrs.open('post', 'https://www.selmerbot.com/setCurrentServer/', true);
xhrs.open('post', 'https://selmerbot.com/setCurrentServer/', true);
xhrs.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrs.setRequestHeader('serverNumber', serverInfo.Id);
xhrs.setRequestHeader('sessionid', window.localStorage.getItem("sessionId"));
+5 -5
View File
@@ -9,7 +9,7 @@
<title>Website Name</title>
<meta content="Selmer Bot Web Dashboard" property="og:title" />
<meta content="A web dashboard for Selmer Bot (still in Beta)" property="og:description" />
<meta content="https://www.selmerbot.com" property="og:url" />
<meta content="https://selmerbot.com" property="og:url" />
<meta content="https://raw.githubusercontent.com/ION606/selmer-bot-website/main/assets/favicon.ico" property="og:image" />
<meta content="#050089" data-react-helmet="true" name="theme-color" />
<meta name="twitter:card" content="summary_large_image">
@@ -102,7 +102,7 @@
const owned = result.filter((inp) => { return (inp.owner); });
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/user/', true);
xhr.open('post', 'https://selmerbot.com/user/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('guilds', JSON.stringify(owned));
xhr.setRequestHeader('userId', window.sessionStorage.getItem('Id'));
@@ -136,19 +136,19 @@
</script>
<script>
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! https://www.selmerbot.com/ -->
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! https://selmerbot.com/ -->
function getAPIRedirect() {
if (window.location.href.indexOf('localhost') != -1) {
return 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
// return "https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmer-bot-website.herokuapp.com%2F&response_type=token&scope=identify%20guilds"
return 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=token&scope=identify%20guilds';
return 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmerbot.com%2F&response_type=token&scope=identify%20guilds';
}
}
function logout() {
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/logout/', true);
xhr.open('post', 'https://selmerbot.com/logout/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionid', window.localStorage.getItem('sessionId'));
+1 -1
View File
@@ -197,7 +197,7 @@
const sid = window.localStorage.getItem('sessionId');
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/joinedGuild', true);
xhr.open('post', 'https://selmerbot.com/joinedGuild', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverNumber', guildId);
xhr.setRequestHeader('sessionid', sid);
+5 -5
View File
@@ -58,7 +58,7 @@
function getSessionData() {
return new Promise((resolve, reject) => {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.open('post', 'https://selmerbot.com/getSessionInfo/', true);
// xhrsess.open('post', 'http://localhost:53134/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
@@ -83,7 +83,7 @@
if (window.location.href.indexOf('localhost') != -1) {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=token&scope=identify%20guilds';
window.location = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmerbot.com%2F&response_type=token&scope=identify%20guilds';
}
}
@@ -118,13 +118,13 @@
imagem.onclick = function() {
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/setCurrentServer/', true);
xhr.open('post', 'https://selmerbot.com/setCurrentServer/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('serverNumber', guilds[i].id);
xhr.setRequestHeader('sessionid', window.localStorage.getItem("sessionId"));
xhr.onloadend = (e) => {
// window.sessionStorage.setItem('serverInfo', (xhr.response));
window.location = 'https://www.selmerbot.com/dashboard';
window.location = 'https://selmerbot.com/dashboard';
}
xhr.send();
}
@@ -137,7 +137,7 @@
if (window.location.href.indexOf('localhost') != -1) {
url = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&permissions=549755289087&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2FjoinedGuild&response_type=code&scope=rpc%20bot%20applications.commands'
} else {
url = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&permissions=549755289087&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2FjoinedGuild&scope=bot%20applications.commands'
url = 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&permissions=549755289087&redirect_uri=https%3A%2F%2Fselmerbot.com%2FjoinedGuild&scope=bot%20applications.commands'
}
window.open(url);
}//OPEN A NEW WINDOW WITH SERVER INVITE
+2 -2
View File
@@ -51,7 +51,7 @@
function getSessionData() {
return new Promise((resolve, reject) => {
var xhrsess = new XMLHttpRequest();
xhrsess.open('post', 'https://www.selmerbot.com/getSessionInfo/', true);
xhrsess.open('post', 'https://selmerbot.com/getSessionInfo/', true);
xhrsess.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhrsess.setRequestHeader('session', window.localStorage.getItem('sessionId'));
@@ -118,7 +118,7 @@
//Send the data to the server
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/newCalEvent/', true);
xhr.open('post', 'https://selmerbot.com/newCalEvent/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader(`newCalEvent`, JSON.stringify(obj));
+3 -3
View File
@@ -38,7 +38,7 @@
function logout() {
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/logout/', true);
xhr.open('post', 'https://selmerbot.com/logout/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionid', window.localStorage.getItem('sessionId'));
@@ -50,13 +50,13 @@
xhr.send();
}
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! https://www.selmerbot.com/ -->
//Get the redirect link <!-- NOTE: "response_type=token" ALWAYS!!! https://selmerbot.com/ -->
function getAPIRedirect() {
if (window.location.href.indexOf('localhost') != -1) {
return 'https://discord.com/api/oauth2/authorize?client_id=926551095352901632&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2F&response_type=token&scope=identify%20guilds';
} else {
// return "https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmer-bot-website.herokuapp.com%2F&response_type=token&scope=identify%20guilds"
return 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fwww.selmerbot.com%2F&response_type=token&scope=identify%20guilds';
return 'https://discord.com/api/oauth2/authorize?client_id=944046902415093760&redirect_uri=https%3A%2F%2Fselmerbot.com%2F&response_type=token&scope=identify%20guilds';
}
}
+2 -2
View File
@@ -40,7 +40,7 @@
if (!sbox.value) { return; }
var xhr = new XMLHttpRequest();
xhr.open('post', 'https://www.selmerbot.com/suggestion/', true);
xhr.open('post', 'https://selmerbot.com/suggestion/', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.setRequestHeader('sessionId', sid);
xhr.setRequestHeader('suggestion', sbox.value);
@@ -114,7 +114,7 @@
<div class="row">
<div style="text-align: center;">
<button onclick="window.open('https://www.selmerbot.com/', target='_blank')" class="webBtn">selmerbot.com</button>
<button onclick="window.open('https://selmerbot.com/', target='_blank')" class="webBtn">selmerbot.com</button>
<script type="text/javascript" src="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js" data-name="bmc-button" data-slug="ion606" data-color="#FFDD00" data-emoji="" data-font="Cookie" data-text="Buy me a coffee" data-outline-color="#000000" data-font-color="#000000" data-coffee-color="#ffffff"></script>
</div>
</div>
+9 -1
View File
@@ -591,6 +591,14 @@ app.post("/newics", async(req, res) => {
*/
app.get("/userData", async (req, res) => {
connection.then((client) => {
const headers = req.headers;
const dbo = client.db();
});
});
app.get('/', async ({ query }, response) => {
const { code } = query;
@@ -603,7 +611,7 @@ app.get('/', async ({ query }, response) => {
client_secret: clientSecret,
code,
grant_type: 'authorization_code',
redirect_uri: `https://www.selmerbot.com/`,
redirect_uri: `https://selmerbot.com/`,
scope: 'identify',
}),
headers: {