Files
dd-multitool/bot/commands/refetch.js
koneko 7a87b284af
Some checks failed
Deploy bot / build-and-deploy (push) Failing after 2s
Readd
2025-08-26 00:28:59 +02:00

26 lines
864 B
JavaScript

exports.name = "refetch";
exports.description = ":ninja: Refetch user react data.";
exports.usage = "CLIENT_PREFIX:refetch";
exports.example = "CLIENT_PREFIX:refetch";
exports.hidden = true;
exports.run = async (client, message, args) => {
if (message.author.id != client.ownerID) return;
try {
const url = "https://drive.overflow.fun/public/react.json";
client.usersToReactTo = [];
const res = await fetch(url);
const data = await res.json();
client.usersToReactTo = data.map((entry) => {
const [userId, emoji] = entry.split("|");
return { userId, emoji };
});
message.channel.send(
"Refetched react data. " + JSON.stringify(client.usersToReactTo)
);
} catch (e) {
message.channel.send("copyparty instance unreachable/offline...");
}
};