Skip to content

Commit

Permalink
Merge pull request #21 from spasten-studio/dev/unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
B0tis authored Feb 18, 2022
2 parents 77ead38 + 50c3bb3 commit aca1c6e
Show file tree
Hide file tree
Showing 30 changed files with 1,258 additions and 1,188 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.DS_Store
/node_modules
/data/.env
/data/data.db
/data/config.env
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<br/>
<br/>
<div align="center">
™ and © 2021 The Golden Authors. All Rights Reserved.
™ and © 2022 The Golden Authors. All Rights Reserved.
</div>
<div align="center">
<br/>
Expand Down
29 changes: 0 additions & 29 deletions data/config.json

This file was deleted.

18 changes: 0 additions & 18 deletions data/example.env

This file was deleted.

47 changes: 47 additions & 0 deletions data/template.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# .env template for Golden 4.3

# Start by copying this file and renaming it to config.env
# The template.env file might change on updates

# Golden
GOLDEN_HEADER="https://cdn.discordapp.com/attachments/911271717492621343/914553180883406898/bg2v3.png"
GOLDEN_EMBED_THUMBNAIL="https://cdn.discordapp.com/attachments/911271717492621343/912002185267646544/bg4.png"
GOLDEN_EMBED_TITLE="<:musicnote:930887306045435934> | No song is being played"
GOLDEN_EMBED_DESCRIPTION="[Bot Invite](https://golden.invite.spasten.studio/) | [Dashboard](https://golden.spasten.studio) | [Commands](https://golden.spasten.studio) | [Support](https://discord.gg/PX28nyVgdP)"
GOLDEN_EMBED_MESSAGE="\n__**Queue:**__\nJoin a Voice Channel and add a Song or a Playlist"

# Discord API see https://discord.com/developers/
DISCORD_TOKEN=""
DISCORD_APPID=""

DISCORD_GLOBAL_COMMANDS=true
DISCORD_GUILDID=""

# MySQL / MariaDB
DB_HOST="localhost"
DB_PORT=3306
DB_USERNAME=""
DB_DATABASE=""
DB_PASSWORD=""

# LavaLink see https://github.com/freyacodes/Lavalink
LAVALINK_HOST="localhost"
LAVALINK_PORT=2333
LAVALINK_PASSWORD=""
LAVALINK_SSL=false

# Spotify see https://developer.spotify.com/dashboard/
SPOTIFY_ENABLED=false
SPOTIFY_CLIENTID=""
SPOTIFY_CLIENTSECRET=""

# Better Uptime see https://betteruptime.com/
BETTERUPTIME_ENABLED=false
BETTERUPTIME_HEARTBEAT_URL=""
BETTERUPTIME_TIME=1
BETTERUPTIME_TIME_TYPE="minute"

# Analytics
# Golden tracks the amount of current listeners and players and save them to the database
# You might use a service like https://grafana.com/ to display the data inside an dashboard
ANALYTICS_ENABLED=false
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "golden",
"version": "4.2.0",
"version": "4.3.0",
"description": "A Premium Discord Bot with a lot of functions and wihtout any Paywalls!",
"main": "./src/golden.js",
"scripts": {
Expand All @@ -9,17 +9,18 @@
"author": "Botis",
"license": "ISC",
"dependencies": {
"@devsnowflake/quick.db": "^2.0.3",
"@discordjs/builders": "^0.9.0",
"@discordjs/rest": "^0.1.0-canary.0",
"better-erela.js-spotify": "^1.3.6",
"better-uptime": "^1.1.4",
"check-links": "^1.1.8",
"console-stamp": "^3.0.3",
"discord-api-types": "^0.25.2",
"discord-together": "^1.3.25",
"discord.js": "^13.3.1",
"dotenv": "^10.0.0",
"erela.js-spotify": "^1.2.0",
"erela.js-vk": "^2.3.3-vk-8",
"format-duration": "^1.4.0"
"format-duration": "^1.4.0",
"mariadb": "^2.5.5"
}
}
9 changes: 5 additions & 4 deletions src/commands/information/status.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { SlashCommandBuilder } = require("@discordjs/builders");
const { MessageEmbed } = require("discord.js");
const { getGlobal } = require("../../modules/databaseModule/databaseModule");
const { getChannelsCreated } = require("../../modules/databaseModule/databaseModule");

module.exports = {
data: new SlashCommandBuilder()
Expand All @@ -26,7 +26,8 @@ module.exports = {
let seconds = Math.floor(totalSeconds % 60);

const usage = process.cpuUsage();

const channelsCreated = await getChannelsCreated();

interaction.editReply({
embeds: [
embed
Expand Down Expand Up @@ -83,12 +84,12 @@ module.exports = {
},
{
name: "Music channels",
value: `${getGlobal().stats.goldenChannelCount}`,
value: `${channelsCreated.value}`,
inline: true,
},
{
name: "Users",
value: `${client.users.cache.size}`,
value: `${client.guilds.cache.map((g) => g.memberCount).reduce((a, c) => a + c)}`,
inline: true,
}
)
Expand Down
4 changes: 2 additions & 2 deletions src/commands/music/autoplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ module.exports = {

const channel = interaction.member.voice;
if (!channel) return replyInteractionEmbed(interaction, '', 'Join a voice channel first.', 'DARK_RED');
if (channel.channel.id!= player.voiceChannel)
if (channel.channelId != player.voiceChannel)
return replyInteractionEmbed(interaction, '', 'I\'ve to be in the same voice channel with you for toggling Autoplay.', 'DARK_RED');

player.set(`autoplay`, !player.get(`autoplay`))
player.set(`autoplay`, !player.get(`autoplay`));

setEmbed(interaction.guild, player);
return replyInteractionEmbed(interaction, '', `**${player.get(`autoplay`) ? "activated" : "deactivated"}** Autoplay`, 'DARK_GREEN');
Expand Down
14 changes: 14 additions & 0 deletions src/commands/music/nowplaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,19 @@ async function NPEmbed(interaction, player)
.setURL('https://www.youtube.com/watch?v=' + queue.current.identifier)
);

if (typeof queue.current.resolve == 'function') await queue.current.resolve();
await replyBtnInteractionEmbed(interaction, '', `<:musicnote:930887306045435934> **Now Playing:** [${queue.current.title} by ${queue.current.author}](${queue.current.uri})\n**Duration:** ${bar} ${formatDuration(player.position)}|${formatDuration(queue.current.duration)}\n**Requested by:** ${queue.current.requester}`, `DARK_GREEN`, queue.current.displayThumbnail("mqdefault"), channelControlComponent);

const Interval = setInterval(() =>
{
const pos = formatDuration(player.position);
if (queue.current == undefined || interaction == undefined || player.position > (queue.current.duration - 5000))
{
editBtnInteractionEmbed(interaction, '', '**Player stopped or its not available anymore!', 'DARK_RED');
clearInterval(Interval);
return;
};
bar = generateProgressBar(player.position, queue.current.duration);
editBtnInteractionEmbed(interaction, '', `<:musicnote:930887306045435934> **Now Playing:** [${queue.current.title} by ${queue.current.author}](${queue.current.uri})\n**Duration:** ${bar} ${pos}|${formatDuration(queue.current.duration)}\n**Requested by:** ${queue.current.requester}`, `DARK_GREEN`, queue.current.displayThumbnail("mqdefault"));
}, 5000);
};
Loading

0 comments on commit aca1c6e

Please sign in to comment.