Question:
Since replit phased out the “Always On” setting, I had to migrate my Discord bot to one of the deployment options. The deployment itself works fine, but every time it tries to fetch a user’s data from the replit database, the whole thing crashes. It prints the following error: “TypeError: Only absolut URLS are supported.” How do I fix this?
Here’s an example of fetching stuff from the database. This one runs every time the bot starts to set up cron jobs, so the bot immediately crashes upon launching.
GetAllProfiles: async function() {
let UserIDs = []
let Profiles = []
return new Promise((resolve) => {
Database.list().then(Keys => {
let Counter = 0
Keys.forEach(function (item, index) {
Database.get(item).then(Profile => {
UserIDs.push(item);
Profiles.push(Profile);
Counter += 1;
if(Counter == (Object.keys(Keys).length)) {
resolve([UserIDs, Profiles]);
}
});
});
});
});
}