add some checks, more work on price estimating
All checks were successful
Deploy bot / build-and-deploy (push) Successful in 13s

This commit is contained in:
2025-08-08 02:15:58 +02:00
parent 6b58361d31
commit e13efd0b07
3 changed files with 112 additions and 22 deletions

View File

@ -4,17 +4,22 @@ 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();
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 };
});
client.usersToReactTo = data.map((entry) => {
const [userId, emoji] = entry.split(":");
return { userId, emoji };
});
message.channel.send(
"Refetched react data. " + JSON.stringify(client.usersToReactTo)
);
message.channel.send(
"Refetched react data. " + JSON.stringify(client.usersToReactTo)
);
} catch (e) {
message.channel.send("copyparty instance unreachable/offline...");
}
};