Version 0.1.1 - Add of /report
This commit is contained in:
parent
86450f642e
commit
fafe8c8e03
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "subsonics-web",
|
"name": "subsonics-web",
|
||||||
"author": "Raphix",
|
"author": "Raphix",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
"ext": "js, html",
|
"ext": "js, html",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
@ -18,11 +18,12 @@ module.exports = {
|
|||||||
{name: "/skip", value: "Passer à la chanson suivante."},
|
{name: "/skip", value: "Passer à la chanson suivante."},
|
||||||
{name: "/previous", value: "Revenir à la chanson précédente."},
|
{name: "/previous", value: "Revenir à la chanson précédente."},
|
||||||
{name: "/about", value: "Affiche les informations principales !"},
|
{name: "/about", value: "Affiche les informations principales !"},
|
||||||
{name: "/web", value: "Donne le lien vers le panel !"})
|
{name: "/web", value: "Donne le lien vers le panel !"},
|
||||||
|
{name: "/report <urgent/bug> <description>", value: "Permet de rapporter un bug (ce qui n'arrive jamais évidemment !) !"})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.addFields({name: "La queue et la gestion du redémarrage se fait par le site https://subsonics.raphix.fr/", value: ":star:"})
|
.addFields({name: "La queue et la gestion du redémarrage se fait par le site https://subsonics.raphix.fr/", value: ":star:"})
|
||||||
.setThumbnail("https://static.wikia.nocookie.net/codelyoko/images/9/95/Subdigitals.jpg/revision/latest/scale-to-width-down/180?cb=20120105180510&path-prefix=fr");
|
.setThumbnail("https://static.wikia.nocookie.net/codelyoko/images/9/95/Subdigitals.jpg/revision/latest/scale-to-width-down/180?cb=20120105180510&path-prefix=fr");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interaction.reply({embeds: [embed]})
|
interaction.reply({embeds: [embed]})
|
||||||
|
53
src/commands/report.js
Normal file
53
src/commands/report.js
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
const { SlashCommandBuilder, EmbedBuilder, Client } = require("discord.js");
|
||||||
|
const { __glob } = require("../modules/global-variables");
|
||||||
|
const { LogType } = require("../modules/sub-log");
|
||||||
|
const { List } = require("../modules/sub-list");
|
||||||
|
const subplayer = require(__glob.SUBPLAYER);
|
||||||
|
const packageJson = require(__glob.PACKAGE);
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
|
||||||
|
data: new SlashCommandBuilder()
|
||||||
|
.setName("report")
|
||||||
|
.setDescription("[NEW] Donne le lien vers le panel !")
|
||||||
|
.addStringOption(option => option.setName("level").setDescription("Niveau du report").setRequired(true).addChoices(
|
||||||
|
{name: "Urgent", value: "urgent"},
|
||||||
|
{name: "Mineur", value: "minor"}
|
||||||
|
)).addStringOption(option => option.setName("desc").setDescription("Description du bug")),
|
||||||
|
|
||||||
|
async execute(client, interaction) {
|
||||||
|
|
||||||
|
const level = interaction.options.getString("level")
|
||||||
|
const desc = interaction.options.getString("desc")
|
||||||
|
|
||||||
|
var embed = new EmbedBuilder()
|
||||||
|
.setTitle('Report de ' + interaction.member.user.username )
|
||||||
|
.setDescription('**Version **' + packageJson.version)
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
|
||||||
|
var levelString = null
|
||||||
|
|
||||||
|
if(level == "urgent") {
|
||||||
|
|
||||||
|
levelString = "Urgent"
|
||||||
|
embed.setColor(0xc20f02)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
levelString = "Mineur"
|
||||||
|
embed.setColor(0xdcff17)
|
||||||
|
}
|
||||||
|
|
||||||
|
embed.addFields({name: "Niveau", value: levelString},{name: "Description", value: desc})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const channel = await client.channels.fetch('1102177962817749033')
|
||||||
|
|
||||||
|
channel.send({embeds: [embed]})
|
||||||
|
channel.send({content: "<@486943594893017119>"})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user