nyx/unused/events/afk.js

26 lines
837 B
JavaScript
Raw Normal View History

const client = require("../..");
2021-09-06 12:38:25 +02:00
client.on("messageCreate", async message => {
if (message.author.bot || !message.guild) return;
2021-06-12 12:53:51 +02:00
const dataa = await client.data.getUser(message.author.id);
if (dataa?.AFK) {
message.reply({
content: `Welcome back <@${dataa.User}>! I have removed your AFK status.`,
});
const nothahaa = message.guild.members.cache.get(message.author.id);
nothahaa.setNickname(`${message.author.username}`).catch();
await client.data.DelAFK(message.author.id);
2021-06-12 12:53:51 +02:00
}
2022-01-22 23:12:37 +01:00
if (message.mentions.users.first()?.id) {
2021-06-12 12:53:51 +02:00
const data1 = await client.data.getUser(
2022-01-22 23:12:37 +01:00
message.mentions.members.first()?.id
2021-06-12 12:53:51 +02:00
);
if (data1?.AFK) {
message.reply({
content: `**${
message.mentions.members.first().user.tag
}** is in afk **(${data1.AFK})**`,
});
2021-06-12 12:53:51 +02:00
}
}
});