mirror of
https://github.com/Lightcord/Lightcord.git
synced 2025-04-12 00:55:40 +02:00
Lightcord Servers first commit
This commit is contained in:
parent
42b08bc8c2
commit
22ac7a8090
File diff suppressed because one or more lines are too long
@ -58,6 +58,7 @@ export const settings = {
|
|||||||
"Calling Ring Beat": {id: "lightcord-2", info: "Enable Discord's special calling beat.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
"Calling Ring Beat": {id: "lightcord-2", info: "Enable Discord's special calling beat.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
||||||
"Developer Options": {id: "lightcord-1", info: "Enable Discord's Internal Developer Options. This allow the \"Experiments\" tab and the \"Developer Options\" tab. (must close and reopen settings)", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
"Developer Options": {id: "lightcord-1", info: "Enable Discord's Internal Developer Options. This allow the \"Experiments\" tab and the \"Developer Options\" tab. (must close and reopen settings)", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
||||||
"Ad Block": {id: "lightcord-4", info: "Block any BOT that dm you with an invite link. Even in an embed.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
"Ad Block": {id: "lightcord-4", info: "Block any BOT that dm you with an invite link. Even in an embed.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
||||||
|
"Enable Lightcord Servers": {id: "lightcord-5", info: "Disabling it erase any informations about you in our servers. But you won't see anything like custom badges.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
||||||
|
|
||||||
/** Lightcord Window */
|
/** Lightcord Window */
|
||||||
"Always-on-Top": {id: "lightcord-3", info: "Enable window's Always-on-Top mode, where Lightcord stays on top of other applications.", implemented: true, hidden: false, cat: "lightcord", category: "Window"},
|
"Always-on-Top": {id: "lightcord-3", info: "Enable window's Always-on-Top mode, where Lightcord stays on top of other applications.", implemented: true, hidden: false, cat: "lightcord", category: "Window"},
|
||||||
@ -103,7 +104,8 @@ export const defaultCookie = {
|
|||||||
"lightcord-2": true,
|
"lightcord-2": true,
|
||||||
"lightcord-presence-1": false,
|
"lightcord-presence-1": false,
|
||||||
"lightcord-3": false,
|
"lightcord-3": false,
|
||||||
"lightcord-4": false
|
"lightcord-4": false,
|
||||||
|
"lightcord-5": true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +27,24 @@ export default new class DistantServer {
|
|||||||
return this._cache = Object.assign(this._cache, data)
|
return this._cache = Object.assign(this._cache, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async delete(){
|
||||||
|
BdApi.showToast("Deleting all infos about you on Lightcord Servers...", {type: "warn"})
|
||||||
|
return handleRequest(Routes.delete, "delete")
|
||||||
|
.then(async res => {
|
||||||
|
if(res.status !== 200){
|
||||||
|
BdApi.showToast("An error occured, couldn't delete informations. See console for more infos", {type: "error"})
|
||||||
|
throw new Error(`Couldn't delete all informations: ${(res.status+" "+res.statusText+" "+await res.text())}`)
|
||||||
|
}
|
||||||
|
console.info(`Succesfully deleted informations.`)
|
||||||
|
BdApi.showToast("Succesfully deleted informations", {type: "success"})
|
||||||
|
window.Lightcord.Api.Authorization = null
|
||||||
|
return res.json()
|
||||||
|
}).catch((err) => {
|
||||||
|
BdApi.showToast("An error occured, couldn't delete informations. See console for more infos", {type: "error"})
|
||||||
|
throw new Error(`Couldn't delete all informations: ${err.stack}`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get custom badges from the user ID.
|
* Get custom badges from the user ID.
|
||||||
* @param {string} user The user ID
|
* @param {string} user The user ID
|
||||||
@ -77,7 +95,8 @@ const handleRequest = function(route, method){
|
|||||||
return fetch(`${Constants.SERVER_URL}/api/v1${route}`, {
|
return fetch(`${Constants.SERVER_URL}/api/v1${route}`, {
|
||||||
method,
|
method,
|
||||||
headers: {
|
headers: {
|
||||||
"CLIENT": "Lightcord"
|
"CLIENT": "Lightcord",
|
||||||
|
"Authorization": window.Lightcord.Api.Authorization || "None::Anonymous"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -86,11 +105,21 @@ export const Constants = {
|
|||||||
SERVER_URL: "http://127.0.0.1",
|
SERVER_URL: "http://127.0.0.1",
|
||||||
badges: [
|
badges: [
|
||||||
{
|
{
|
||||||
name: "Bug Hunter",
|
name: "Lightcord User",
|
||||||
|
id: "01cfa7b0-7cdb-4b0e-8258-9c6a78235c93",
|
||||||
|
defaultUsers: [
|
||||||
|
"696481194443014174"
|
||||||
|
],
|
||||||
|
scopes: [
|
||||||
|
"user"
|
||||||
|
],
|
||||||
|
component: BugHunterBadge,
|
||||||
|
href: "https://github.com/lightcord/lightcord/wiki/badges/bug_hunter"
|
||||||
|
}, {
|
||||||
|
name: "Lightcord Bug Hunter",
|
||||||
id: "f04698f5-816b-41e3-bd01-92291193d7a5",
|
id: "f04698f5-816b-41e3-bd01-92291193d7a5",
|
||||||
defaultUsers: [
|
defaultUsers: [
|
||||||
"696481194443014174",
|
"696481194443014174"
|
||||||
"585858920149549067"
|
|
||||||
],
|
],
|
||||||
scopes: [],
|
scopes: [],
|
||||||
component: BugHunterBadge,
|
component: BugHunterBadge,
|
||||||
@ -100,7 +129,6 @@ export const Constants = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Routes = {
|
export const Routes = {
|
||||||
badges(user){
|
badges: user => `/${user}/badges`,
|
||||||
return `/${user}/badges`
|
delete: `/delete`
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user