nyx/unused/commands/Utilities/afk.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2022-10-26 12:38:28 +02:00
const { EmbedBuilder } = require("discord.js");
2021-09-06 12:38:25 +02:00
module.exports = {
name: "afk",
description: "Tell someone you are AFK.",
usage: "{Status}",
category: "Utilities",
2022-10-26 12:38:28 +02:00
2021-09-06 12:38:25 +02:00
options: [
{
type: 3,
name: "status",
description: "The status that shows to user while you are AFK",
required: false,
},
],
run: async (client, interaction, args) => {
const uuser = interaction.guild.members.cache.get(interaction.user.id);
2021-09-06 12:38:25 +02:00
const content = args[0] || "No status provided.";
uuser.setNickname(`[AFK] ${interaction.user.username}`).catch();
2021-09-06 12:38:25 +02:00
await client.data.AFK(interaction.user.id, content);
2022-10-26 12:38:28 +02:00
const embed = new EmbedBuilder()
2021-09-06 12:38:25 +02:00
.setDescription(
`${interaction.user.username} is set into AFK.\nStatus : ${content}`
)
.setTimestamp()
2022-03-02 19:37:05 +01:00
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
2021-09-06 12:38:25 +02:00
.setColor(client.color)
2022-03-02 19:37:05 +01:00
.setAuthor({
text: interaction.user.username,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
2021-09-06 12:38:25 +02:00
.setURL(client.web);
interaction.followUp({ embeds: [embed] });
2021-09-06 12:38:25 +02:00
},
};