RitsuProject / Ritsu

A Discord Bot based on the AnimeMusicQuiz (AMQ) game, play using your MAL/Anilist animelist and with different game modes! ✨
https://ritsu.fun
MIT License
23 stars 2 forks source link

Self-Hosting Guide #84

Closed cybormar closed 3 years ago

cybormar commented 3 years ago

sup, is there any guide or anything for self-hosting?

Sazzo commented 3 years ago

Yo! I intend to do this later this week which I'm working on a big update, but the self-hosting process for now is very simple (I'm sorry if I miss something, it's my first time doing something open-source for real)

Sorry for the last minute explanation, if you have any questions feel free to join in to the support server or send me a DM Remember to follow the license.

https://discord.gg/XuDysZg sazz#0002

cybormar commented 3 years ago

Aight, tysm I was confused about what should I put in API_URL but, seems like it's clear now. Tho before I hosted that API on my own PC but it didn't work. I was getting animethemes returning null and the location of the error is from ThemesController.ts line 226. I was also wondering what if I have to put the same MongoDB URL and bot token in that API too?

Sazzo commented 3 years ago

Aight, tysm I was confused about what should I put in API_URL but, seems like it's clear now. Tho before I hosted that API on my own PC but it didn't work. I was getting animethemes returning null and the location of the error is from ThemesController.ts line 226. I was also wondering what if I have to put the same MongoDB URL and bot token in that API too?

It seems to be something related to the endpoint that Ritsu uses to see the statuses that we change, create a collection in your MongoDB with the id as "servers" and put the rest as described here

https://github.com/RitsuProject/Mio/blob/main/src/models/Servers.ts

Sazzo commented 3 years ago

Also, i think that maybe I forgot to put in the example of .env, yes, put the token of your instance using the variable DISCORD_TOKEN in .env and the same MongoDB url plz

cybormar commented 3 years ago

Aight, tysm I was confused about what should I put in API_URL but, seems like it's clear now. Tho before I hosted that API on my own PC but it didn't work. I was getting animethemes returning null and the location of the error is from ThemesController.ts line 226. I was also wondering what if I have to put the same MongoDB URL and bot token in that API too?

It seems to be something related to the endpoint that Ritsu uses to see the statuses that we change, create a collection in your MongoDB with the id as "servers" and put the rest as described here

https://github.com/RitsuProject/Mio/blob/main/src/models/Servers.ts So, I have to keep the bot token and mongodb same for both Discord Bot and API i see. What id I have to put in Servers collection? Guild ID or My own id or ?

Sazzo commented 3 years ago

Aight, tysm I was confused about what should I put in API_URL but, seems like it's clear now. Tho before I hosted that API on my own PC but it didn't work. I was getting animethemes returning null and the location of the error is from ThemesController.ts line 226. I was also wondering what if I have to put the same MongoDB URL and bot token in that API too?

It seems to be something related to the endpoint that Ritsu uses to see the statuses that we change, create a collection in your MongoDB with the id as "servers" and put the rest as described here https://github.com/RitsuProject/Mio/blob/main/src/models/Servers.ts So, I have to keep the bot token and mongodb same for both Discord Bot and API i see. What id I have to put in Servers collection? Guild ID or My own id or ?

Put the id as "servers".

Sazzo commented 3 years ago

Added a little information about self-hosting and other stuff in README.md, i should do this soon in the other repositories like the in the API.

cybormar commented 3 years ago

This should be fine right? image

Sazzo commented 3 years ago

yup!

cybormar commented 3 years ago

I'm getting this error now.

[GAME_SERVICE] GUILD -> 0000000000000000000 | SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at CentraResponse.json (node_modules\centra\model\CentraResponse.js:17:48)
    at phin (node_modules\phin\lib\phin.js:75:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async getProviderStatus (src\utils\getProviderStatus.js:14:21)
    at async GameService.choose (src\handlers\GameHandler.js:290:20)
    at async GameService.getTheme (src\handlers\GameHandler.js:276:19)
    at async GameService.startNewRound (src\handlers\GameHandler.js:95:19)
Sazzo commented 3 years ago

I'm getting this error now.

[GAME_SERVICE] GUILD -> 0000000000000000000 | SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at CentraResponse.json (node_modules\centra\model\CentraResponse.js:17:48)
    at phin (node_modules\phin\lib\phin.js:75:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async getProviderStatus (src\utils\getProviderStatus.js:14:21)
    at async GameService.choose (src\handlers\GameHandler.js:290:20)
    at async GameService.getTheme (src\handlers\GameHandler.js:276:19)
    at async GameService.startNewRound (src\handlers\GameHandler.js:95:19)

Can you access the API URL you put in API_URL and access the path /themes/status?

Like: http://localhost:3001/themes/status and see what appears.

Should be like this: image

Sazzo commented 3 years ago

Just a reminder, if you're running on localhost, the protocol that should generally be used is http, so it's supposed to be something like http://localhost instead of https://localhost

Sazzo commented 3 years ago

Closing this for now.