21 lines
642 B
JavaScript
21 lines
642 B
JavaScript
exports.name = "refetch";
|
|
exports.description = ":ninja: Refetch user react data. (shiro)";
|
|
exports.usage = "<<refetch";
|
|
exports.example = "<<refetch";
|
|
exports.hidden = true;
|
|
exports.run = async (client, message, args) => {
|
|
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)
|
|
);
|
|
};
|