Delete src directory
This commit is contained in:
@@ -1,29 +0,0 @@
|
|||||||
const { EmbedBuilder } = require("discord.js");
|
|
||||||
const { SlashCommandBuilder } = require("@discordjs/builders");
|
|
||||||
const config = require("../../../CONFIGS/config.json")
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
data: new SlashCommandBuilder()
|
|
||||||
.setName("hilfe")
|
|
||||||
.setDescription("🎺 | Brauchst du Hilfe?"),
|
|
||||||
run: async (client, interaction) => {
|
|
||||||
let embed_author_text = config.radio_embed_theme.embed_author_text;
|
|
||||||
let embed_author_icon = config.radio_embed_theme.embed_author_icon;
|
|
||||||
let embed_footer_text = config.radio_embed_theme.embed_footer_text;
|
|
||||||
let embed_footer_icon = config.radio_embed_theme.embed_footer_icon;
|
|
||||||
let embed_color = config.radio_embed_theme.embed_color;
|
|
||||||
|
|
||||||
var HilfeEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "HILFE", iconURL: embed_author_icon })
|
|
||||||
.setDescription("[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `Support@SynRadio.de`!\n## Du brauchst Hilfe?")
|
|
||||||
.addFields(
|
|
||||||
{ name: "/Radio", value: "Starte den Radio für die beste Laune!", inline: true },
|
|
||||||
{ name: "/Stop", value: "Stoppe den Radio für die schlechteste Laune!", inline: true },
|
|
||||||
{ name: "/Stats", value: "Siehe die aktuellen Stats des Radio's ein.", inline: true },
|
|
||||||
)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
return interaction.reply({ embeds: [HilfeEmbed], ephemeral: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,474 +0,0 @@
|
|||||||
const { EmbedBuilder } = require("discord.js");
|
|
||||||
const { SlashCommandBuilder } = require("@discordjs/builders");
|
|
||||||
const config = require("../../../CONFIGS/config.json")
|
|
||||||
const { joinVoiceChannel, createAudioPlayer, createAudioResource, getVoiceConnection } = require("@discordjs/voice");
|
|
||||||
const mysql = require("mysql");
|
|
||||||
const NodeCache = require( "node-cache" );
|
|
||||||
const myCache = new NodeCache();
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
data: new SlashCommandBuilder()
|
|
||||||
.setName("radio")
|
|
||||||
.setDescription("🎺 | Starte den Radio für die beste Laune!"),
|
|
||||||
run: async (client, interaction) => {
|
|
||||||
const AudioPlayer = createAudioPlayer();
|
|
||||||
const voiceChannel = interaction.member.voice.channel;
|
|
||||||
|
|
||||||
const embed_author_text = config.radio_embed_theme.embed_author_text;
|
|
||||||
const embed_author_icon = config.radio_embed_theme.embed_author_icon;
|
|
||||||
const embed_footer_text = config.radio_embed_theme.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.radio_embed_theme.embed_footer_icon;
|
|
||||||
const embed_color = config.radio_embed_theme.embed_color;
|
|
||||||
|
|
||||||
const db = mysql.createConnection({
|
|
||||||
host: config.generell.db_host,
|
|
||||||
port: config.generell.db_port,
|
|
||||||
user: config.generell.db_username,
|
|
||||||
password: config.generell.db_password,
|
|
||||||
database: config.generell.db_name,
|
|
||||||
});
|
|
||||||
|
|
||||||
db.connect(async function (err) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!voiceChannel) {
|
|
||||||
const voiceChannelEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "SPRACHKANAL", iconURL: embed_author_icon })
|
|
||||||
.setDescription("[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `Support@SynRadio.de`!\n## Du musst in einem Sprachkanal sein um das Musik System zu nutzen!")
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
return interaction.reply({ embeds: [voiceChannelEmbed], ephemeral: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interaction.guild.members.me.voice.channelId !== null) {
|
|
||||||
if (interaction.member.voice.channelId !== interaction.guild.members.me.voice.channelId) {
|
|
||||||
const alreadyActiveEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "BEREITS AKTIV", iconURL: embed_author_icon })
|
|
||||||
.setDescription(`[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `+"`Support@SynRadio.de`"+`!\n## Der Bot ist auf diesen Server bereits aktiv! Du findest den Radio in <#`+interaction.guild.members.me.voice.channelId+`>!`)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
return interaction.reply({ embeds: [alreadyActiveEmbed], ephemeral: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
function CheckTableGetData() {
|
|
||||||
const GuildID = interaction.guild.id;
|
|
||||||
const SQL1 = "SHOW TABLES;"
|
|
||||||
db.query(SQL1, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const res1 = Object.assign({}, result);
|
|
||||||
const resp = JSON.stringify(res1);
|
|
||||||
if (resp.includes(GuildID)) {
|
|
||||||
const imvciCD = interaction.member.voice.channel.id;
|
|
||||||
const igiCD = interaction.guild.id;
|
|
||||||
const igvCD = interaction.guild.voiceAdapterCreator;
|
|
||||||
|
|
||||||
myCache.set("igvCC"+interaction.guild.id, interaction.guild.voiceAdapterCreator);
|
|
||||||
|
|
||||||
const SQL3 = "UPDATE `"+GuildID+"` SET imvciC = "+imvciCD+" WHERE 1;";
|
|
||||||
const SQL4 = "UPDATE `"+GuildID+"` SET igiC = "+igiCD+" WHERE 2;";
|
|
||||||
const SQL5 = "UPDATE `"+GuildID+"` SET igvC = "+igvCD+" WHERE 3;";
|
|
||||||
const SQL6 = "UPDATE `"+GuildID+"` SET active = true WHERE 4;";
|
|
||||||
db.query(SQL3, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
db.query(SQL4, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
db.query(SQL5, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
db.query(SQL6, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
const SQL2 = "CREATE TABLE `"+GuildID+"` (`imvciC` VARCHAR(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL , `igiC` VARCHAR(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL , `igvC` LONGTEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL , `active` INT(11) NULL DEFAULT '0' ) ENGINE = InnoDB;";
|
|
||||||
db.query(SQL2, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const SQL3 = "INSERT INTO `"+GuildID+"` (imvciC, igiC, igvC, active) VALUES (0, 0, 0, false);";
|
|
||||||
db.query(SQL3, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
CheckTableGetData();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function MaxListeners() {
|
|
||||||
const GuildID = interaction.guild.id;
|
|
||||||
const connection = getVoiceConnection(GuildID)
|
|
||||||
connection.setMaxListeners(75);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ReJoin() {
|
|
||||||
setTimeout(() => {
|
|
||||||
const GuildID = interaction.guild.id;
|
|
||||||
const SQL1 = "SELECT active from `"+GuildID+"`;";
|
|
||||||
db.query(SQL1, function(err, result) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const res1 = Object.assign({}, result);
|
|
||||||
const res2 = JSON.stringify(res1);
|
|
||||||
const res3 = res2.split("");
|
|
||||||
const resp = res3[15];
|
|
||||||
if (resp.includes("1")) {
|
|
||||||
const SQL1 = "SELECT igiC from `"+GuildID+"`;";
|
|
||||||
db.query(SQL1, function(err, result) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const resp = result.values();
|
|
||||||
for (const value of resp) {
|
|
||||||
const igi = (value["igiC"]);
|
|
||||||
const connection = getVoiceConnection(igi)
|
|
||||||
AudioPlayer.stop();
|
|
||||||
connection.destroy();
|
|
||||||
JoinChannel();
|
|
||||||
MaxListeners();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}})
|
|
||||||
}, 3600000); //3600000
|
|
||||||
}
|
|
||||||
|
|
||||||
function JoinChannel() {
|
|
||||||
const GuildID = interaction.guild.id;
|
|
||||||
const SQL1 = "SELECT active from `"+GuildID+"`;";
|
|
||||||
db.query(SQL1, function(err, result) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const res1 = Object.assign({}, result);
|
|
||||||
const res2 = JSON.stringify(res1);
|
|
||||||
const res3 = res2.split("");
|
|
||||||
const resp = res3[15];
|
|
||||||
if (resp.includes("1")) {
|
|
||||||
const SQL2 = "SELECT imvciC from `"+GuildID+"`;";
|
|
||||||
db.query(SQL2, async function(err, result) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const resp = result.values();
|
|
||||||
for (const value of resp) {
|
|
||||||
const imvciC = (value["imvciC"]);
|
|
||||||
const SQL3 = "SELECT igiC from `"+GuildID+"`;";
|
|
||||||
db.query(SQL3, async function(err, result) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const resp = result.values();
|
|
||||||
for (const value of resp) {
|
|
||||||
const igiC = (value["igiC"]);
|
|
||||||
const SQL4 = "SELECT igvC from `"+GuildID+"`;";
|
|
||||||
db.query(SQL4, async function(err, result) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const resp = result.values();
|
|
||||||
for (const value of resp) {
|
|
||||||
const igvC = (value["igvC"]);
|
|
||||||
|
|
||||||
let Radio = config.generell.radio_link;
|
|
||||||
let Audio = createAudioResource(Radio);
|
|
||||||
AudioPlayer.play(Audio);
|
|
||||||
|
|
||||||
const igvCCD = myCache.get("igvCC"+interaction.guild.id);
|
|
||||||
|
|
||||||
joinVoiceChannel({
|
|
||||||
channelId: imvciC,
|
|
||||||
guildId: igiC,
|
|
||||||
adapterCreator: igvCCD
|
|
||||||
}).subscribe(AudioPlayer)
|
|
||||||
|
|
||||||
ReJoin();
|
|
||||||
MaxListeners();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {CheckTableGetData();}, 100);
|
|
||||||
setTimeout(() => {CheckTableGetData();}, 200);
|
|
||||||
setTimeout(() => {JoinChannel();}, 1000);
|
|
||||||
|
|
||||||
const RadioPlay = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "GESTARTET", iconURL: embed_author_icon })
|
|
||||||
.setDescription("[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `Support@SynRadio.de`!\n## Die beste Laune ist garantiert!")
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
setTimeout(() => {interaction.reply({ embeds: [RadioPlay], ephemeral: true });}, 1000);
|
|
||||||
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
let { EmbedBuilder } = require("discord.js");
|
|
||||||
let { SlashCommandBuilder } = require("@discordjs/builders");
|
|
||||||
let config = require("../../../CONFIGS/config.json")
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
data: new SlashCommandBuilder()
|
|
||||||
.setName("stats")
|
|
||||||
.setDescription("🎺 | Siehe generelle Stats vom Bot als auch vom Web Radio!"),
|
|
||||||
run: async (client, interaction) => {
|
|
||||||
let embed_author_text = config.radio_embed_theme.embed_author_text;
|
|
||||||
let embed_author_icon = config.radio_embed_theme.embed_author_icon;
|
|
||||||
let embed_footer_text = config.radio_embed_theme.embed_footer_text;
|
|
||||||
let embed_footer_icon = config.radio_embed_theme.embed_footer_icon;
|
|
||||||
let embed_color = config.radio_embed_theme.embed_color;
|
|
||||||
|
|
||||||
let Data = await fetch("https://api.laut.fm/station/synradiode/listeners");
|
|
||||||
if(Data.ok) {
|
|
||||||
let listenersData = await Data.json();
|
|
||||||
let Data1 = await fetch("https://api.laut.fm/station/synradiode/current_song");
|
|
||||||
if(Data1.ok) {
|
|
||||||
let SongData = await Data1.json();
|
|
||||||
|
|
||||||
let HilfeEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "STATS", iconURL: embed_author_icon })
|
|
||||||
.setDescription("[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `Support@SynRadio.de`!\n## Die wichtigsten Stats!")
|
|
||||||
.addFields(
|
|
||||||
{ name: "DC Server", value: `${client.guilds.cache.size}`, inline: true },
|
|
||||||
{ name: "DC Nutzer", value: `${client.users.cache.size}`, inline: true },
|
|
||||||
{ name: "DC Verbindungen", value: `${client.voice.adapters.size}`, inline: true },
|
|
||||||
{ name: "Web-Radio Verbindungen", value: `${listenersData}`, inline: true },
|
|
||||||
{ name: "aktueller Song", value: `${SongData.title + " von " + SongData.artist.name || "Akutell Spielt kein Song!"}`, inline: true }
|
|
||||||
)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [HilfeEmbed], ephemeral: true });
|
|
||||||
}
|
|
||||||
} else (err) => {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
let embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
let embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
let embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
let embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
let embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
let embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
let ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,334 +0,0 @@
|
|||||||
const { EmbedBuilder } = require("discord.js");
|
|
||||||
const { SlashCommandBuilder } = require("@discordjs/builders");
|
|
||||||
const config = require("../../../CONFIGS/config.json")
|
|
||||||
const { getVoiceConnection, createAudioResource } = require('@discordjs/voice');
|
|
||||||
const mysql = require("mysql");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
data: new SlashCommandBuilder()
|
|
||||||
.setName("stop")
|
|
||||||
.setDescription("🎺 | Stoppe den Radio für die schlechteste Laune!"),
|
|
||||||
run: async (client, interaction) => {
|
|
||||||
const voiceChannel = interaction.member.voice.channel;
|
|
||||||
|
|
||||||
let embed_author_text = config.radio_embed_theme.embed_author_text;
|
|
||||||
let embed_author_icon = config.radio_embed_theme.embed_author_icon;
|
|
||||||
let embed_footer_text = config.radio_embed_theme.embed_footer_text;
|
|
||||||
let embed_footer_icon = config.radio_embed_theme.embed_footer_icon;
|
|
||||||
let embed_color = config.radio_embed_theme.embed_color;
|
|
||||||
|
|
||||||
const db = mysql.createConnection({
|
|
||||||
host: config.generell.db_host,
|
|
||||||
port: config.generell.db_port,
|
|
||||||
user: config.generell.db_username,
|
|
||||||
password: config.generell.db_password,
|
|
||||||
database: config.generell.db_name,
|
|
||||||
});
|
|
||||||
|
|
||||||
db.connect(async function (err) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!voiceChannel) {
|
|
||||||
const voiceChannelEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "SPRACHKANAL", iconURL: embed_author_icon })
|
|
||||||
.setDescription("[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `Support@SynRadio.de`!\n## Du musst in einem Sprachkanal sein um das Musik System zu nutzen!")
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
return interaction.reply({ embeds: [voiceChannelEmbed], ephemeral: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interaction.guild.members.me.voice.channelId !== null) {
|
|
||||||
if (interaction.member.voice.channelId !== interaction.guild.members.me.voice.channelId) {
|
|
||||||
const alreadyActiveEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "BEREITS AKTIV", iconURL: embed_author_icon })
|
|
||||||
.setDescription(`[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `+"`Support@SynRadio.de`"+`!\n## Der Bot ist auf diesen Server bereits aktiv! Du findest den Radio in <#`+interaction.guild.members.me.voice.channelId+`>!`)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
return interaction.reply({ embeds: [alreadyActiveEmbed], ephemeral: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
function CheckTableGetData() {
|
|
||||||
const GuildID = interaction.guild.id;
|
|
||||||
const SQL1 = "SHOW TABLES;"
|
|
||||||
db.query(SQL1, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const res1 = Object.assign({}, result);
|
|
||||||
const resp = JSON.stringify(res1);
|
|
||||||
if (resp.includes(GuildID)) {
|
|
||||||
const imvciCD = interaction.member.voice.channel.id;
|
|
||||||
const igiCD = interaction.guild.id;
|
|
||||||
const igvCD = interaction.guild.voiceAdapterCreator;
|
|
||||||
|
|
||||||
const SQL3 = "UPDATE `"+GuildID+"` SET imvciC = "+imvciCD+" WHERE 1;";
|
|
||||||
const SQL4 = "UPDATE `"+GuildID+"` SET igiC = "+igiCD+" WHERE 2;";
|
|
||||||
const SQL5 = "UPDATE `"+GuildID+"` SET igvC = "+igvCD+" WHERE 3;";
|
|
||||||
const SQL6 = "UPDATE `"+GuildID+"` SET active = false WHERE 4;";
|
|
||||||
db.query(SQL3, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
db.query(SQL4, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
db.query(SQL5, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
db.query(SQL6, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
const SQL2 = "CREATE TABLE `"+GuildID+"` (`imvciC` VARCHAR(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL , `igiC` VARCHAR(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL , `igvC` LONGTEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL , `active` INT(11) NULL DEFAULT '0' ) ENGINE = InnoDB;";
|
|
||||||
db.query(SQL2, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const SQL3 = "INSERT INTO `"+GuildID+"` (imvciC, igiC, igvC, active) VALUES (0, 0, 0, 0);";
|
|
||||||
db.query(SQL3, function (err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
CheckTableGetData();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function StopRadio() {
|
|
||||||
const GuildID = interaction.guild.id;
|
|
||||||
const SQL1 = "SELECT active from `"+GuildID+"`;";
|
|
||||||
db.query(SQL1, function(err, result) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
const res1 = Object.assign({}, result);
|
|
||||||
const res2 = JSON.stringify(res1);
|
|
||||||
const res3 = res2.split("");
|
|
||||||
const resp = res3[16];
|
|
||||||
if (resp.includes("1")) {
|
|
||||||
const SQL2 = "UPDATE `"+GuildID+"` SET active = 0 WHERE 4;";
|
|
||||||
db.query(SQL2, function(err, result){
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
const embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
const embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
const embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
const embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
const embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
const embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
RadioDisconnect();
|
|
||||||
const StopRadioEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "GESTOPPT", iconURL: embed_author_icon })
|
|
||||||
.setDescription("[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `Support@SynRadio.de`!\n## Der Radio wurde leider gestoppt.")
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [StopRadioEmbed], ephemeral: true });
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
RadioDisconnect();
|
|
||||||
const AlreadyStopped = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text + "GESTOPPT", iconURL: embed_author_icon })
|
|
||||||
.setDescription("[LautFM](https://laut.fm/synradiode) | [Webseite](https://synradio.de/) | [Impressum](https://synradio.de/impressum.html)\nKontaktiere uns unter `Support@SynRadio.de`!\n## Der Radio ist bereits gestoppt.")
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
return interaction.reply({ embeds: [AlreadyStopped], ephemeral: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function RadioDisconnect() {
|
|
||||||
try {
|
|
||||||
const connection = getVoiceConnection(interaction.guild.id);
|
|
||||||
connection.disconnect();
|
|
||||||
} catch (err) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {CheckTableGetData();}, 100)
|
|
||||||
setTimeout(() => {StopRadio();}, 600)
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
let embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
let embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
let embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
let embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
let embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
let embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
let ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
let { Events, ActivityType } = require("discord.js");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: Events.ClientReady,
|
|
||||||
once: false,
|
|
||||||
execute: async (client) => {
|
|
||||||
setInterval(async () => {
|
|
||||||
try {
|
|
||||||
const url = await fetch("https://api.laut.fm/station/synradiode/current_song");
|
|
||||||
if (url.ok) {
|
|
||||||
let RadioData = await url.json();
|
|
||||||
|
|
||||||
client.user.setPresence({
|
|
||||||
activities: [
|
|
||||||
{
|
|
||||||
name: `🎺 ${RadioData.title + " von " + RadioData.artist.name || "Akutell Spielt kein Song!"}`,
|
|
||||||
type: ActivityType.Custom,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
status: `🎺 ${RadioData.title + " von " + RadioData.artist.name || "Akutell Spielt kein Song!"}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
}, 3500);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
const { Events } = require("discord.js");
|
|
||||||
const moment = require("moment");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: Events.MessageCreate,
|
|
||||||
once: false,
|
|
||||||
execute: async (message) => {
|
|
||||||
if (message.guild) return;
|
|
||||||
console.log(
|
|
||||||
`[${moment().format("DD-MM-YYYY HH:mm:ss")}] Der Bot hat eine DM von ` +
|
|
||||||
message.author.username +
|
|
||||||
` erhalten mit Inhalt '` +
|
|
||||||
message.content +
|
|
||||||
`'!`
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
const { Events, InteractionType } = require("discord.js");
|
|
||||||
const config = require("../../CONFIGS/config.json")
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: Events.InteractionCreate,
|
|
||||||
execute: async(interaction) => {
|
|
||||||
let client = interaction.client;
|
|
||||||
if (interaction.type == InteractionType.ApplicationCommand) {
|
|
||||||
if (interaction.user.bot) return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const command = client.slashcommands.get(interaction.commandName)
|
|
||||||
command.run(client, interaction)
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
let embed_author_text = config.fehler_embed.embed_author_text;
|
|
||||||
let embed_author_icon = config.fehler_embed.embed_author_icon;
|
|
||||||
let embed_description = config.fehler_embed.embed_description.replace("%error%", "" + err + "");
|
|
||||||
let embed_footer_text = config.fehler_embed.embed_footer_text;
|
|
||||||
let embed_footer_icon = config.fehler_embed.embed_footer_icon;
|
|
||||||
let embed_color = config.fehler_embed.embed_color;
|
|
||||||
|
|
||||||
const ErrEmbed = new EmbedBuilder()
|
|
||||||
.setAuthor({ name: embed_author_text, iconURL: embed_author_icon })
|
|
||||||
.setDescription(embed_description)
|
|
||||||
.setTimestamp()
|
|
||||||
.setFooter({ text: embed_footer_text, iconURL: embed_footer_icon })
|
|
||||||
.setColor(embed_color)
|
|
||||||
interaction.reply({ embeds: [ErrEmbed], ephemeral: true})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
const { Events } = require("discord.js");
|
|
||||||
const { REST } = require("@discordjs/rest");
|
|
||||||
const { Routes } = require("discord-api-types/v10");
|
|
||||||
const moment = require("moment");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: Events.ClientReady,
|
|
||||||
once: true,
|
|
||||||
execute: async (client) => {
|
|
||||||
const rest = new REST({ version: "10" }).setToken(client.token);
|
|
||||||
|
|
||||||
console.log(`[${moment().format("DD-MM-YYYY HH:mm:ss")}] Angemeldet als ${client.user.username}!`);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await rest.put(Routes.applicationCommands(client.user.id), {
|
|
||||||
body: client.slashdatas,
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
console.log(`[${moment().format("DD-MM-YYYY HH:mm:ss")}] Ein Fehler ist aufgetreten:` + err);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user