Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webhooks working? #9

Open
Sz4by opened this issue Oct 26, 2024 · 15 comments
Open

webhooks working? #9

Sz4by opened this issue Oct 26, 2024 · 15 comments

Comments

@Sz4by
Copy link

Sz4by commented Oct 26, 2024

Hmm?

@Sz4by
Copy link
Author

Sz4by commented Oct 26, 2024

Where should I enter?

@Carbowix
Copy link
Owner

Carbowix commented Oct 27, 2024

Hi @Sz4by ,
The installation is pretty simple.

  • Extract the files into a folder and run npm install through your CMD.
  • Create a file in the same folder maybe called index.js
  • Add the following code to it:
 const newswire = require('./newswire');
 const latestNews = new newswire(type, webhookURL);
  • Replace "type" with any of the following types: rdr2, gtav, latest, music, fanart, fanvideos, creator, tips, rockstar, updates.
  • Replace webhookURL with your webhook's URL.

Example of using gtav as the type

 const newswire = require('./newswire');
 const latestNews = new newswire("gtav", "https://...");
  • Save the file and run node index.js in your CMD. It should show the news every 2 hours if there's any new articles on the newswire.

Hopefully, I'll organize the project to make it more user-friendly, but that should do it for now. If you have any issues, feel free to reply to this issue or open a new one.

@Sz4by
Copy link
Author

Sz4by commented Oct 27, 2024

And it doesn't matter where I enter it?

@Carbowix
Copy link
Owner

And it doesn't matter where I enter it?

Yeah as long the library is linked correctly, you can put that piece of code anywhere, and it should run. Whether it is a bot or another script that runs all the time.

@Sz4by
Copy link
Author

Sz4by commented Oct 27, 2024

Thank you, and one more question, it's not possible to put Hungarian language, right?

@Carbowix
Copy link
Owner

Thank you, and one more question, it's not possible to put Hungarian language, right?

Library currently doesn't support language localization for news, but I'll probably give it a small update later this week to support languages and other stuff.

For now, you can change the following line with your language locale code. For example I want it to be German, so I would change it to "de_de"

But for Hungarian language "hu_hu" there's bad news, Rockstar Newswire doesn't support Hungarian locale. It only supports the following languages. (Maybe try it, who knows it might work)
image

@Sz4by
Copy link
Author

Sz4by commented Oct 27, 2024

It's ok thanks

@Sz4by
Copy link
Author

Sz4by commented Oct 27, 2024

Is it okay if I put it at the beginning?
Screenshot_20241027-123820~2

@Carbowix
Copy link
Owner

if you'll put it on the same file as the newswire.js then you won't need the first line and to run it would be node newswire.js

@Sz4by
Copy link
Author

Sz4by commented Oct 27, 2024

[READY] Started news feed for gtav. Feed refreshes every 2 hours.
This is what he says to me, but he hasn't sent anything to discord yet

@Carbowix
Copy link
Owner

[READY] Started news feed for gtav. Feed refreshes every 2 hours.
This is what he says to me, but he hasn't sent anything to discord yet

If it's just freshly deployed, it should send the latest article in the category, and it'll refresh every 2 hours in case a new article is released in that time-frame. If it didn't send, make sure that webhook url is correct

@Sz4by
Copy link
Author

Sz4by commented Oct 27, 2024

I think it only works on Windows and not on hosting?

@Sz4by
Copy link
Author

Sz4by commented Oct 27, 2024

Isn't there one that works on Linux?

@Carbowix
Copy link
Owner

Carbowix commented Oct 27, 2024

Yeah I think, it won't work with Linux for now. At the time of its creation, I was just making it for fun. Probably I'll update it this week with quality-of-life changes.

@Sz4by
Copy link
Author

Sz4by commented Oct 27, 2024

It would be nice if Linux worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants