mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
upgrade 2 commands
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'dnd',
|
||||
description: 'Changer le status du bot en dnd',
|
||||
emote: '🔕',
|
||||
utilisation: 'dnd',
|
||||
category: 'botcontrol',
|
||||
async execute(message, args, client) {
|
||||
|
||||
client.user.setStatus('dnd');
|
||||
message.channel.send(`Le bot est maintenant en de pas deranger`);
|
||||
},
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'idle',
|
||||
description: 'Changer le status du bot en idle',
|
||||
emote: '🔄',
|
||||
utilisation: 'idle',
|
||||
category: 'botcontrol',
|
||||
|
||||
async execute(message, args, client) {
|
||||
client.user.setStatus('idle');
|
||||
message.channel.send(`Le bot est maintenant en mode idle`);
|
||||
},
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'invisible',
|
||||
description: 'Changer le status du bot en invisible',
|
||||
emote: '🕶️',
|
||||
utilisation: 'invisible',
|
||||
category: 'botcontrol',
|
||||
|
||||
async execute(message, args, client) {
|
||||
client.user.setStatus('invisible');
|
||||
message.channel.send(`Le bot est maintenant invisible`);
|
||||
},
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
const { ActivityType } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'listen',
|
||||
aliases: ['écoute'],
|
||||
description: 'Changer le status du bot en listen',
|
||||
emote: '🎧',
|
||||
utilisation: 'listen <status>',
|
||||
category: 'botcontrol',
|
||||
async execute(message, args, client) {
|
||||
const streamText = args.join(' ') || 'Streaming';
|
||||
const streamURL = 'https://www.twitch.tv/valou336_yt';
|
||||
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: streamText,
|
||||
type: ActivityType.Listening,
|
||||
url: streamURL
|
||||
}]
|
||||
});
|
||||
|
||||
message.channel.send(`Le bot est maintenant en streaming : ${streamText}`);
|
||||
},
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'online',
|
||||
description: 'Changer le status du bot en online',
|
||||
emote: '🟢',
|
||||
utilisation: 'online',
|
||||
category: 'botcontrol',
|
||||
|
||||
async execute(message, args, client) {
|
||||
client.user.setStatus('online');
|
||||
message.channel.send(`Le bot est maintenant en ligne`);
|
||||
},
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
const { ActivityType } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'play',
|
||||
aliases: ['joue'],
|
||||
description: 'Changer le status du bot en play',
|
||||
emote: '🎵',
|
||||
utilisation: 'play <status>',
|
||||
category: 'botcontrol',
|
||||
|
||||
async execute(message, args, client) {
|
||||
const streamText = args.join(' ') || 'Streaming';
|
||||
const streamURL = 'https://www.twitch.tv/valou336_yt';
|
||||
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: streamText,
|
||||
type: ActivityType.Playing,
|
||||
url: streamURL
|
||||
}]
|
||||
});
|
||||
|
||||
message.channel.send(`Le bot est maintenant en streaming : ${streamText}`);
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,126 @@
|
||||
const { EmbedBuilder, StringSelectMenuBuilder, ActionRowBuilder, ActivityType } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'setactivity',
|
||||
description: 'Changer la présence du bot',
|
||||
emote: '🎮',
|
||||
utilisation: '',
|
||||
permission: '8',
|
||||
utilisation: 'setactivity',
|
||||
category: 'botcontrol',
|
||||
async execute(message, args, client) {
|
||||
const author = message.author;
|
||||
|
||||
let currentActivitie = client.user.presence.activities[0];
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Changement d\'activité')
|
||||
.setDescription(`Le bot est en mode :\`${currentActivitie}\``)
|
||||
.setTimestamp()
|
||||
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL()});
|
||||
|
||||
if (!currentActivitie) {
|
||||
embed.setColor('#000000');
|
||||
} else if (currentActivitie.name === 'playing') {
|
||||
embed.setColor('#FF0000');
|
||||
} else if (currentActivitie.name === 'streaming') {
|
||||
embed.setColor('#FFA500');
|
||||
} else if (currentActivitie.name === 'listening') {
|
||||
embed.setColor('#00FF00');
|
||||
} else if (currentActivitie.name === 'watching') {
|
||||
embed.setColor('#000000');
|
||||
}
|
||||
|
||||
const selectMenu = new StringSelectMenuBuilder()
|
||||
.setCustomId('activity')
|
||||
.setPlaceholder('Changer l\'activité')
|
||||
.addOptions([
|
||||
{
|
||||
label: 'Joue',
|
||||
value: 'playing',
|
||||
description: 'Le bot joue',
|
||||
emoji: '🎮'
|
||||
},
|
||||
{
|
||||
label: 'Stream',
|
||||
value: 'streaming',
|
||||
description: 'Le bot stream',
|
||||
emoji: '📺'
|
||||
},
|
||||
{
|
||||
label: 'Écoute',
|
||||
value: 'listening',
|
||||
description: 'Le bot écoute',
|
||||
emoji: '🎵'
|
||||
},
|
||||
{
|
||||
label: 'Regarde',
|
||||
value: 'watching',
|
||||
description: 'Le bot regarde',
|
||||
emoji: '👀'
|
||||
}
|
||||
]);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(selectMenu)
|
||||
|
||||
const sendMessage = await message.reply({ embeds: [embed], components: [row] });
|
||||
|
||||
let filter = (interaction) => interaction.user.id === message.author.id;
|
||||
const collector = sendMessage.createMessageComponentCollector({ filter, time: 60000 });
|
||||
collector.on('collect', async (interaction) => {
|
||||
if (interaction.isStringSelectMenu()) {
|
||||
const value = interaction.values[0];
|
||||
|
||||
interaction.reply(`Veuillez entrer le message que vous voulez afficher pour l'activité ${value}`);
|
||||
filter = (message) => message.author.id === author.id;
|
||||
const messageCollector = message.channel.createMessageCollector({ filter, time: 60000 });
|
||||
messageCollector.on('collect', async (messageCollect) => {
|
||||
const text = messageCollect.content;
|
||||
const url = 'https://www.twitch.tv/tuturp33';
|
||||
|
||||
if (!client.user) return;
|
||||
if (value === 'playing') {
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: text,
|
||||
type: ActivityType.Playing,
|
||||
url: url
|
||||
}]
|
||||
});
|
||||
} else if (value === 'streaming') {
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: text,
|
||||
type: ActivityType.Streaming,
|
||||
url: url
|
||||
}]
|
||||
});
|
||||
} else if (value === 'listening') {
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: text,
|
||||
type: ActivityType.Listening,
|
||||
url: url
|
||||
}]
|
||||
});
|
||||
} else if (value === 'watching') {
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: text,
|
||||
type: ActivityType.Watching,
|
||||
url: url
|
||||
}]
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
collector.on('end', async () => {
|
||||
sendMessage.edit({ components: [] });
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,101 @@
|
||||
const { EmbedBuilder, StringSelectMenuBuilder, ActionRowBuilder } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'setstatus',
|
||||
description: 'Changer le status du bot',
|
||||
emote: '🟢',
|
||||
utilisation: '',
|
||||
permission: '8',
|
||||
utilisation: 'setstatus',
|
||||
category: 'botcontrol',
|
||||
async execute(message, args, client) {
|
||||
let currentStatus = client.user.presence.status;
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Changement de status')
|
||||
.setDescription(`Le bot est en mode :\`${currentStatus}\``)
|
||||
.setTimestamp()
|
||||
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL()});
|
||||
|
||||
if (currentStatus === 'dnd') {
|
||||
embed.setColor('#FF0000');
|
||||
} else if (currentStatus === 'idle') {
|
||||
embed.setColor('#FFA500');
|
||||
} else if (currentStatus === 'online') {
|
||||
embed.setColor('#00FF00');
|
||||
} else if (currentStatus === 'offline') {
|
||||
embed.setColor('#000000');
|
||||
} else {
|
||||
embed.setColor('#000000');
|
||||
}
|
||||
|
||||
const selectMenu = new StringSelectMenuBuilder()
|
||||
.setCustomId('status')
|
||||
.setPlaceholder('Changer le status')
|
||||
.addOptions([
|
||||
{
|
||||
label: 'En ligne',
|
||||
value: 'online',
|
||||
description: 'Le bot sera en ligne',
|
||||
emoji: '🟢'
|
||||
},
|
||||
{
|
||||
label: 'Absent',
|
||||
value: 'idle',
|
||||
description: 'Le bot sera absent',
|
||||
emoji: '🟠'
|
||||
},
|
||||
{
|
||||
label: 'Ne pas déranger',
|
||||
value: 'dnd',
|
||||
description: 'Le bot ne sera pas déranger',
|
||||
emoji: '🔴'
|
||||
},
|
||||
{
|
||||
label: 'Invisible',
|
||||
value: 'offline',
|
||||
description: 'Le bot sera invisible',
|
||||
emoji: '⚫'
|
||||
}
|
||||
]);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(selectMenu)
|
||||
|
||||
const sendMessage = await message.reply({ embeds: [embed], components: [row] });
|
||||
|
||||
const filter = (interaction) => interaction.user.id === message.author.id;
|
||||
const collector = sendMessage.createMessageComponentCollector({ filter, time: 60000 });
|
||||
collector.on('collect', async (interaction) => {
|
||||
if (interaction.isStringSelectMenu()) {
|
||||
if (!client.user) return
|
||||
const value = interaction.values[0];
|
||||
if (value === 'online') {
|
||||
client.user.setStatus('online');
|
||||
embed.setDescription('Le bot est maintenant en ligne');
|
||||
embed.setColor('#00FF00');
|
||||
await interaction.update({ embeds: [embed], components: [row] });
|
||||
} else if (value === 'idle') {
|
||||
client.user.setStatus('idle');
|
||||
embed.setDescription('Le bot est maintenant absent');
|
||||
embed.setColor('#FFA500');
|
||||
await interaction.update({ embeds: [embed], components: [row] });
|
||||
} else if (value === 'dnd') {
|
||||
client.user.setStatus('dnd');
|
||||
embed.setDescription('Le bot est maintenant en mode ne pas déranger');
|
||||
embed.setColor('#FF0000');
|
||||
await interaction.update({ embeds: [embed], components: [row] });
|
||||
} else if (value === 'offline') {
|
||||
client.user.setStatus('invisible');
|
||||
embed.setDescription('Le bot est maintenant invisible');
|
||||
embed.setColor('#000000');
|
||||
await interaction.update({ embeds: [embed], components: [row] });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
collector.on('end', async () => {
|
||||
sendMessage.edit({ components: [] });
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
const { ActivityType } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'stream',
|
||||
aliases: ['streaming'],
|
||||
description: 'Mettre le bot en stream',
|
||||
emote: '🎥',
|
||||
utilisation: 'stream <status>',
|
||||
category: 'botcontrol',
|
||||
async execute(message, args, client) {
|
||||
const streamText = args.join(' ') || 'Streaming';
|
||||
const streamURL = 'https://www.twitch.tv/valou336_yt';
|
||||
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: streamText,
|
||||
type: ActivityType.Streaming,
|
||||
url: streamURL
|
||||
}]
|
||||
});
|
||||
|
||||
message.channel.send(`Le bot est maintenant en streaming : ${streamText}`);
|
||||
},
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
const { ActivityType } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'watch',
|
||||
aliases: ['regarde'],
|
||||
description: 'Changer le status du bot en watch',
|
||||
emote: '👁️',
|
||||
utilisation: 'watch <status>',
|
||||
category: 'botcontrol',
|
||||
|
||||
async execute(message, args, client) {
|
||||
const streamText = args.join(' ') || 'Streaming';
|
||||
const streamURL = 'https://www.twitch.tv/valou336_yt';
|
||||
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: streamText,
|
||||
type: ActivityType.Watching,
|
||||
url: streamURL
|
||||
}]
|
||||
});
|
||||
|
||||
message.channel.send(`Le bot est maintenant en streaming : ${streamText}`);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user