Open Acendro opened 1 year ago
Hey @Acendro! You need to use the manager's fetch
method.
const Client = require('replapi-it');
const client = new Client('MY_SUPER_SECRET_SID');
client.on('ready', async () => {
let me = client.user;
let repls = await me.repls.fetch(); // Returns a Collection, which is just a Map with extra methods
console.log(repls);
})
If you want to get a specific repl by it's url, you should be able to use
let repl = await client.repls.fetch('/@username/repl-slug', {url: true});
Hey @pikachub2005,
everything works as intended. Awesome stuff, thanks a lot =)
Can I start another file than main.py?
[...]
let cons = repl.console;
console.log("STARTING");
await cons.run();
await cons.send("python test.py");
Is what I tried after reading crosis.js but it doesn't work =(
await cons.run();
starts main.py but await cons.send("python test.py");
doesn't seem to do anything
Is it even possible? Do I maybe need to alter my .replit file for it to work?
@Acendro That's not possible in my opinion.
Hi there,
I was excited to test the api, but I can't get it to work properly. So
console.log(me)
gives me a bunch of information on my account so I assume my SID is entered correctly As a next step I wanted to log out all the repls I have but the commandme.repls
returnsReplManager { cache: Collection(0) [Map] {} }
So this is where I'm stuck. I can't loop over the ReplManager object and me.repls[0] = undefined Is there any way to directly connect to a specific Repl I own? like me.repls['REPL_NAME'] or something. Or is the ReplManager not showing anything because my Repls are private? I'm kinda just starting out with hosting some private project at replit and would really appreciate you help.Thanks in advance =)
I also tried
with no success =(