Alkaar / resy-booking-bot

🔫 Helps to snipe hard to get reservations at restaurants that use resy
407 stars 214 forks source link

Instructions for running it? #11

Closed stewx closed 2 years ago

stewx commented 3 years ago

Do I just need to run "sbt" to run the server? Are there any other commands required?

mohnik1 commented 2 years ago

Any updates here? I've got vs code and scala (metals) dl but cant build it.

Alkaar commented 2 years ago

Sorry for not keeping up to date on these issues as I've not used nor maintained the bot due to the pandemic. As of now, it seems that Resy updated the API endpoint so the contract is completely different. I have tried to go through the bot to fix things but I haven't gotten around to fixing it completely. Just wanted to make you all aware.

mohnik1 commented 2 years ago

Ahh thank you for posting! Eagerly awaiting an update to get this running :) Hope you're safe and healthy.

Alkaar commented 2 years ago

Hey, so I did finally get around to fixing the bot along with a few minor fixes. Give it a shot and LMK your thoughts.

In terms of running it, I just hit run in IntelliJ. I believe it should figure it out since there is only one main class. If that's not working for you, LMK and I can update the documentation with that info.

mohnik1 commented 2 years ago

Great to hear! I just redownloaded and built it in IntelliJ & VSC, but cant get it to run. Any chance you could provide a screenshot?

On Tue, Aug 2, 2022 at 5:29 PM Alkaar @.***> wrote:

Hey, so I did finally get around to fixing the bot along with a few minor fixes. Give it a shot and LMK your thoughts.

In terms of running it, I just hit run in IntelliJ. I believe it should figure it out since there is only one main class. If that's not working for you, LMK and I can update the documentation with that info.

— Reply to this email directly, view it on GitHub https://github.com/Alkaar/resy-booking-bot/issues/11#issuecomment-1203232607, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYEFQZUGWUNBNNGKRGD5A5DVXGHMDANCNFSM5AUCF4OQ . You are receiving this because you commented.Message ID: @.***>

Alkaar commented 2 years ago

@mohnik1 could you provide a bit more context about the error you are seeing when you say you cant get it to run so I have a better idea of how to help you.

Also I did a fairly large internal refactor and just pushed a bugfix I accidentally introduce so please try pulling it again.

mohnik1 commented 2 years ago

@Alkaar I have never used IntelliJ so sorry for my lack of knowledge...but I build it then go to run and receive:

Error: Could not find or load main class com.resy.ResyBookingBot Caused by: java.lang.ClassNotFoundException: com.resy.ResyBookingBot

Alkaar commented 2 years ago

@mohnik1 you have to specify the main entry point of the class to run which lives in com.resy.ResyBookingBot. IntelliJ tries to find it for you automatically but sometimes it can't.

Screen Shot 2022-08-13 at 12 30 49 PM

Also since this is a Scala app, you can run it via sbt by simply typing sbt and then typing run.

thierryskoda commented 2 years ago

@Alkaar Never really used Scala. If I run sbt run the code runs with success but ends.

How does it work after this? Where does the bot actually is? Is it stored somewhere internally and runs a background job using internal system?

Thank you very much for building this!

Alkaar commented 2 years ago

So when you run sbt, it spins up a JVM instance, and executing run after that will run the bot inside of that JVM instance. When you run sbt run within the same command, it runs whatever command you pass to sbt in that one instance of the JVM and then immediately kills it. So in your case, you are killing the bot before it's even had a chance to complete. It would be synonymous with running IntelliJ, running the bot, then killing IntelliJ.

So run sbt as one command, then run as the second command.

I've had a lot of people use my bot who are not that familiar with Scala and sbt so I can put some run instructions in the readme for guidance.

thierryskoda commented 2 years ago

@Alkaar Thank you! It worked 🙌

Alkaar commented 2 years ago

Added instructions for running the bot in this PR 👉 https://github.com/Alkaar/resy-booking-bot/pull/36

Will close this issue if no other concerns

mohnik1 commented 2 years ago

@mohnik1 you have to specify the main entry point of the class to run which lives in com.resy.ResyBookingBot. IntelliJ tries to find it for you automatically but sometimes it can't.

Screen Shot 2022-08-13 at 12 30 49 PM

Also since this is a Scala app, you can run it via sbt by simply typing sbt and then typing run.

@Alkaar I'm not sure why its still throwing an error, the directory & class look to be defined correctly. Apologies for being a complete nub at this, but am I looking in the wrong place? Below is what I'm seeing.

Screen Shot 2022-08-30 at 9 27 58 PM Screen Shot 2022-08-30 at 9 27 45 PM Screen Shot 2022-08-30 at 9 27 13 PM

Alkaar commented 2 years ago

I don't think you've set up IntelliJ correctly. If you notice, my folder hierarchy looks slightly different. Notably the scala folder is blue. This tells IntelliJ that the source code lives there. Yours is not set up that way so likely that is at least one of the reasons IntelliJ can't find the main class.

Folder Hierarchy Screen Shot 2022-08-30 at 9 43 19 PM

Below can be found under File ➡️ Project Structure ➡️ Project Settings ➡️ Modules ➡️ Sources Screen Shot 2022-08-30 at 9 43 01 PM

mohnik1 commented 2 years ago

@Alkaar Thank you, made some progress here...looks like the folder hierarchy was the main issue. Loaded a new project & defined the sources, looks to be configured correctly. Only receiving a build error on timing formats now.

Screen Shot 2022-08-30 at 10 40 33 PM Screen Shot 2022-08-30 at 10 40 27 PM

Alkaar commented 2 years ago

See 👉 https://github.com/Alkaar/resy-booking-bot/issues/27#issuecomment-1219538418

Alkaar commented 2 years ago

I haven't heard back here but if no issues, I'm going to be closing this. I also added more instructions in the readme. Feel free to reopen if there are any more questions regarding this.

Alkaar commented 2 years ago

FYI since a lot of people had some confusion around how to set the reservation time and table type, I made a change to hopefully make this a little bit more clear 👉 https://github.com/Alkaar/resy-booking-bot/pull/54

btseng0102 commented 1 year ago

i made the scala folder my source and it resolved the issue of com.resy not being found, but now the "ResyBookingBot' portion of "com.resy.ResyBookingBot" is showing an error and I'm not sure how to fix it.

CleanShot 2023-07-19 at 23 41 30 CleanShot 2023-07-19 at 23 42 03

Alkaar commented 1 year ago

I wrote up a Wiki on getting started since a lot of people were asking questions on this. Specifically, see if the troubleshooting section helps