First Implements Progression Bar
All checks were successful
Subsonics - Pipeline/pipeline/head This commit looks good
All checks were successful
Subsonics - Pipeline/pipeline/head This commit looks good
This commit is contained in:
parent
6aec5ec3b6
commit
8add3c13b7
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -6,9 +6,9 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
echo "[Subsonics-Deploy] - Test Stage"
|
echo "[Subsonics-Deploy] - Test Stage"
|
||||||
sh "rm -rf subsonics"
|
sh "rm -rf bot"
|
||||||
sh "git clone https://git.raphix.fr/raphix/subsonics.git"
|
sh "git clone https://git.raphix.fr/subsonics/bot.git"
|
||||||
sh "cd subsonics"
|
sh "cd bot"
|
||||||
sh "npm i"
|
sh "npm i"
|
||||||
sh "ENV='TEST' node src/main.js"
|
sh "ENV='TEST' node src/main.js"
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "subsonics-discord",
|
"name": "subsonics-discord",
|
||||||
"author": "Raphix",
|
"author": "Raphix",
|
||||||
"version": "5.5",
|
"version": "6.0",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
"ext": "js, html",
|
"ext": "js, html",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
@ -34,8 +34,8 @@ module.exports = {
|
|||||||
|
|
||||||
const nodes = [
|
const nodes = [
|
||||||
{
|
{
|
||||||
host: "lavalink.devamop.in",
|
host: "lavalink.lexnet.cc",
|
||||||
password: "DevamOP",
|
password: "lexn3tl@val!nk",
|
||||||
port: 443,
|
port: 443,
|
||||||
secure: true
|
secure: true
|
||||||
}
|
}
|
||||||
|
69
src/main.js
69
src/main.js
@ -129,8 +129,8 @@ function startDiscordBot() {
|
|||||||
|
|
||||||
const nodes = [
|
const nodes = [
|
||||||
{
|
{
|
||||||
host: "lavalink.devamop.in",
|
host: "lavalink.lexnet.cc",
|
||||||
password: "DevamOP",
|
password: "lexn3tl@val!nk",
|
||||||
port: 443,
|
port: 443,
|
||||||
secure: true
|
secure: true
|
||||||
}
|
}
|
||||||
@ -460,6 +460,35 @@ function startServer(client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.on("loop", (token) => {
|
||||||
|
|
||||||
|
if(users.has(token)) {
|
||||||
|
|
||||||
|
let player = client.manager.players.get("137291455336022018")
|
||||||
|
|
||||||
|
log.server("Looping demandé par" + users.get(token).username + "#" + users.get(token).discriminator)
|
||||||
|
|
||||||
|
if(player) {
|
||||||
|
|
||||||
|
if(player.queueRepeat == true) {
|
||||||
|
player.setQueueRepeat(false)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
player.setQueueRepeat(true)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
actualize()
|
||||||
|
} else {
|
||||||
|
socket.emit("authFailed")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
socket.on("exit", (token) => {
|
socket.on("exit", (token) => {
|
||||||
@ -530,13 +559,28 @@ function startServer(client) {
|
|||||||
"playing": 0,
|
"playing": 0,
|
||||||
"current":null,
|
"current":null,
|
||||||
"isOnline": false,
|
"isOnline": false,
|
||||||
"queue": null
|
"queue": null,
|
||||||
|
"loop": false,
|
||||||
|
"durationNow": null,
|
||||||
|
"durationAll": null
|
||||||
}
|
}
|
||||||
|
|
||||||
if(player) {
|
if(player) {
|
||||||
|
|
||||||
data["current"] = player.queue.current
|
data["current"] = player.queue.current
|
||||||
|
|
||||||
|
if(player.queueRepeat == true) {
|
||||||
|
|
||||||
|
data["loop"] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(player.queue.current) {
|
||||||
|
data["durationNow"] = player.position
|
||||||
|
data["durationAll"] = player.queue.current.duration
|
||||||
|
}
|
||||||
|
|
||||||
if(player.playing == true && player.paused == false) {
|
if(player.playing == true && player.paused == false) {
|
||||||
|
|
||||||
data["playing"] = 1
|
data["playing"] = 1
|
||||||
@ -667,7 +711,7 @@ function startServer(client) {
|
|||||||
|
|
||||||
function createIdentity(response, token, socket) {
|
function createIdentity(response, token, socket) {
|
||||||
|
|
||||||
console.log(response)
|
|
||||||
log.server("Discord Auth : REQUESTING DATA - TOKEN : " + token + " - DISCORD_ACCESS_TOKEN : " + response.access_token)
|
log.server("Discord Auth : REQUESTING DATA - TOKEN : " + token + " - DISCORD_ACCESS_TOKEN : " + response.access_token)
|
||||||
|
|
||||||
fetch('https://discord.com/api/users/@me', {
|
fetch('https://discord.com/api/users/@me', {
|
||||||
@ -684,7 +728,7 @@ function startServer(client) {
|
|||||||
async function addIdentity(response, token, socket) {
|
async function addIdentity(response, token, socket) {
|
||||||
|
|
||||||
|
|
||||||
console.log(response)
|
|
||||||
log.server("Discord Auth : [IDENTITE] : Nouvelle identité - SOCKET_ID : " + socket.id + " - DISCORD_USER : " + response.username + "#" + response.discriminator)
|
log.server("Discord Auth : [IDENTITE] : Nouvelle identité - SOCKET_ID : " + socket.id + " - DISCORD_USER : " + response.username + "#" + response.discriminator)
|
||||||
|
|
||||||
|
|
||||||
@ -694,24 +738,19 @@ function startServer(client) {
|
|||||||
|
|
||||||
await fs.writeFileSync(__dirname + path.sep + "tokens.json", JSON.stringify(tokens, null, 2))
|
await fs.writeFileSync(__dirname + path.sep + "tokens.json", JSON.stringify(tokens, null, 2))
|
||||||
|
|
||||||
await addAllUsers()
|
await users.set(token, response)
|
||||||
|
|
||||||
await socket.emit("successLogin", token)
|
|
||||||
|
|
||||||
|
|
||||||
|
socket.emit("successLogin", token)
|
||||||
actualize()
|
actualize()
|
||||||
|
|
||||||
authTokenWait.delete(token)
|
authTokenWait.delete(token)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addAllUsers() {
|
|
||||||
|
|
||||||
users = new Map()
|
|
||||||
for(var user in tokens) {
|
|
||||||
|
|
||||||
users.set(user , tokens[user])
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
137
src/tokens.json
137
src/tokens.json
@ -1,3 +1,138 @@
|
|||||||
{
|
{
|
||||||
|
"c6eda614-d07f-4411-8b9d-c03a56722999": {
|
||||||
|
"id": "486943594893017119",
|
||||||
|
"username": "Raphix",
|
||||||
|
"global_name": null,
|
||||||
|
"display_name": null,
|
||||||
|
"avatar": "883ec1a7136b0aa3c22e4bdc33e278e5",
|
||||||
|
"discriminator": "8434",
|
||||||
|
"public_flags": 4194368,
|
||||||
|
"flags": 4194368,
|
||||||
|
"banner": null,
|
||||||
|
"banner_color": "#ff4d4d",
|
||||||
|
"accent_color": 16731469,
|
||||||
|
"locale": "fr",
|
||||||
|
"mfa_enabled": true,
|
||||||
|
"premium_type": 0,
|
||||||
|
"avatar_decoration": null
|
||||||
|
},
|
||||||
|
"6c50f21c-2d73-4176-8d9f-ef84b8ab9997": {
|
||||||
|
"id": "486943594893017119",
|
||||||
|
"username": "Raphix",
|
||||||
|
"global_name": null,
|
||||||
|
"display_name": null,
|
||||||
|
"avatar": "883ec1a7136b0aa3c22e4bdc33e278e5",
|
||||||
|
"discriminator": "8434",
|
||||||
|
"public_flags": 4194368,
|
||||||
|
"flags": 4194368,
|
||||||
|
"banner": null,
|
||||||
|
"banner_color": "#ff4d4d",
|
||||||
|
"accent_color": 16731469,
|
||||||
|
"locale": "fr",
|
||||||
|
"mfa_enabled": true,
|
||||||
|
"premium_type": 0,
|
||||||
|
"avatar_decoration": null
|
||||||
|
},
|
||||||
|
"5fe53ab5-5d26-4d2b-9d1f-0068492d01a4": {
|
||||||
|
"id": "486943594893017119",
|
||||||
|
"username": "Raphix",
|
||||||
|
"global_name": null,
|
||||||
|
"display_name": null,
|
||||||
|
"avatar": "883ec1a7136b0aa3c22e4bdc33e278e5",
|
||||||
|
"discriminator": "8434",
|
||||||
|
"public_flags": 4194368,
|
||||||
|
"flags": 4194368,
|
||||||
|
"banner": null,
|
||||||
|
"banner_color": "#ff4d4d",
|
||||||
|
"accent_color": 16731469,
|
||||||
|
"locale": "fr",
|
||||||
|
"mfa_enabled": true,
|
||||||
|
"premium_type": 0,
|
||||||
|
"avatar_decoration": null
|
||||||
|
},
|
||||||
|
"b85c122c-f68f-4248-ab38-868693aa92a7": {
|
||||||
|
"id": "486943594893017119",
|
||||||
|
"username": "Raphix",
|
||||||
|
"global_name": null,
|
||||||
|
"display_name": null,
|
||||||
|
"avatar": "883ec1a7136b0aa3c22e4bdc33e278e5",
|
||||||
|
"discriminator": "8434",
|
||||||
|
"public_flags": 4194368,
|
||||||
|
"flags": 4194368,
|
||||||
|
"banner": null,
|
||||||
|
"banner_color": "#ff4d4d",
|
||||||
|
"accent_color": 16731469,
|
||||||
|
"locale": "fr",
|
||||||
|
"mfa_enabled": true,
|
||||||
|
"premium_type": 0,
|
||||||
|
"avatar_decoration": null
|
||||||
|
},
|
||||||
|
"a6148b9d-6d83-42c8-bca7-7000ca70185b": {
|
||||||
|
"id": "486943594893017119",
|
||||||
|
"username": "Raphix",
|
||||||
|
"global_name": null,
|
||||||
|
"display_name": null,
|
||||||
|
"avatar": "883ec1a7136b0aa3c22e4bdc33e278e5",
|
||||||
|
"discriminator": "8434",
|
||||||
|
"public_flags": 4194368,
|
||||||
|
"flags": 4194368,
|
||||||
|
"banner": null,
|
||||||
|
"banner_color": "#ff4d4d",
|
||||||
|
"accent_color": 16731469,
|
||||||
|
"locale": "fr",
|
||||||
|
"mfa_enabled": true,
|
||||||
|
"premium_type": 0,
|
||||||
|
"avatar_decoration": null
|
||||||
|
},
|
||||||
|
"241cb45e-f597-4ab9-b678-12f86e498862": {
|
||||||
|
"id": "486943594893017119",
|
||||||
|
"username": "Raphix",
|
||||||
|
"global_name": null,
|
||||||
|
"display_name": null,
|
||||||
|
"avatar": "883ec1a7136b0aa3c22e4bdc33e278e5",
|
||||||
|
"discriminator": "8434",
|
||||||
|
"public_flags": 4194368,
|
||||||
|
"flags": 4194368,
|
||||||
|
"banner": null,
|
||||||
|
"banner_color": "#ff4d4d",
|
||||||
|
"accent_color": 16731469,
|
||||||
|
"locale": "fr",
|
||||||
|
"mfa_enabled": true,
|
||||||
|
"premium_type": 0,
|
||||||
|
"avatar_decoration": null
|
||||||
|
},
|
||||||
|
"49c3072b-7bd6-471b-a955-13572682e130": {
|
||||||
|
"id": "486943594893017119",
|
||||||
|
"username": "Raphix",
|
||||||
|
"global_name": null,
|
||||||
|
"display_name": null,
|
||||||
|
"avatar": "883ec1a7136b0aa3c22e4bdc33e278e5",
|
||||||
|
"discriminator": "8434",
|
||||||
|
"public_flags": 4194368,
|
||||||
|
"flags": 4194368,
|
||||||
|
"banner": null,
|
||||||
|
"banner_color": "#ff4d4d",
|
||||||
|
"accent_color": 16731469,
|
||||||
|
"locale": "fr",
|
||||||
|
"mfa_enabled": true,
|
||||||
|
"premium_type": 0,
|
||||||
|
"avatar_decoration": null
|
||||||
|
},
|
||||||
|
"198af2b4-3248-4d0e-b37c-fbdffb336c11": {
|
||||||
|
"id": "486943594893017119",
|
||||||
|
"username": "Raphix",
|
||||||
|
"global_name": null,
|
||||||
|
"display_name": null,
|
||||||
|
"avatar": "883ec1a7136b0aa3c22e4bdc33e278e5",
|
||||||
|
"discriminator": "8434",
|
||||||
|
"public_flags": 4194368,
|
||||||
|
"flags": 4194368,
|
||||||
|
"banner": null,
|
||||||
|
"banner_color": "#ff4d4d",
|
||||||
|
"accent_color": 16731469,
|
||||||
|
"locale": "fr",
|
||||||
|
"mfa_enabled": true,
|
||||||
|
"premium_type": 0,
|
||||||
|
"avatar_decoration": null
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user