This repository has been archived on 2025-08-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
shiro-calculator/commands/refetch.js
koneko 1009165751
All checks were successful
Deploy bot / build-and-deploy (push) Successful in 14s
abstract away prefix + ev cmd
2025-08-08 17:03:24 +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...");
}
};