2021-11-18 18:56:42 +01:00
|
|
|
const client = require("../");
|
2021-09-06 12:38:25 +02:00
|
|
|
client.on("messageCreate", async message => {
|
2021-11-18 18:56:42 +01:00
|
|
|
if (message.author.bot || !message.guild) return;
|
2021-06-12 12:53:51 +02:00
|
|
|
const dataa = await client.data.getUser(message.author.id);
|
2021-11-18 18:56:42 +01:00
|
|
|
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
|
|
|
}
|
2021-11-18 18:56:42 +01:00
|
|
|
if (message.mentions.users.first()) {
|
2021-06-12 12:53:51 +02:00
|
|
|
const data1 = await client.data.getUser(
|
|
|
|
message.mentions.members.first().id
|
|
|
|
);
|
2021-11-18 18:56:42 +01: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
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|