TalatPlays Posted September 4, 2017 Share Posted September 4, 2017 Hello World ! i was trying to add discord-bot to my server using Necktrox/mta-discord-bot , but i don't know how to install these things bellow : - app.js -package.json -package-lock.json the whole src things are :Oed up with me sockets are working but it still shows this problem in console | ERROR: discord/socket.lua:56: attempt to call global 'sockOpen' (a nil value) any help please ? @Necktrox Link to comment
Administrators Lpsd Posted September 6, 2017 Administrators Share Posted September 6, 2017 @Moha|M| Still need help? What OS are you using? Link to comment
TalatPlays Posted September 6, 2017 Author Share Posted September 6, 2017 7 hours ago, LopSided_ said: @Moha|M| Still need help? What OS are you using? Yes please ,i'm using Linux 64 bit . Link to comment
Administrators Lpsd Posted September 6, 2017 Administrators Share Posted September 6, 2017 Well first you should make sure you have nodejs and npm installed on your machine. Open up your console/ssh and check with the two commands: # node -v # npm -v If they are installed then a version number will return. If not, it will say 'node' not found or such. If they are not installed, you will need to run the following (FOR CENTOS - INCLUDES EPEL REPO) # yum install epel-release # yum install nodejs (FOR MOST OTHER BUILDS) # apt-get install nodejs # apt-get install build-essential I'm not an expert on Linux but 1 of those two should work depending on what OS you're running. Don't run both of these (yum AND apt-get), you only need to use either yum or apt-get - depending on your OS! After that's done, you should check again with the version commands above to ensure they are installed. Next, download the mta-discord-bot from GitHub and extract the src folder somewhere, I'll call it PATH-TO-SRC in this example # cd /PATH-TO-SRC # npm install After that, you should edit the example.config.json to include the same details that are in the discord bot resource on your MTA server (in config.xml), then rename that file to config.json. Once everything has been edited, you can now run the app.js. This is the relay which grabs the data from your discord and feeds it through to the MTA server resource. I would advise you run this in a seperate screen (terminal multiplexer)... This means that when you exit the SSH/console, the app.js will continue to run. My choice is tmux, install as so; # yum install tmux OR # apt-get install tmux Now you can run tmux, and run node.js # tmux # cd /PATH-TO-SRC # node app.js If it's all working it should run without errors. You can exit from this window at any time and return to your standard SSH screen by pressing CTRL + B, then let go and press D To re-attach to that window, check your tmux sessions and attach, ie; # tmux list-sessions 0: 1 windows (created Wed Aug 16 18:24:24 2017) [80x23] # tmux attach -t 0 0 in this case being the session id, as shown from list-sessions. If you run into any trouble let me know 1 Link to comment
Administrators Lpsd Posted September 6, 2017 Administrators Share Posted September 6, 2017 also; https://wiki.multitheftauto.com/wiki/Modules/Sockets 1 Link to comment
TalatPlays Posted September 6, 2017 Author Share Posted September 6, 2017 (edited) Thank you very much , but when i type # node -v in console it shows nothing ! Edited September 6, 2017 by Moha|M| Link to comment
Administrators Lpsd Posted September 6, 2017 Administrators Share Posted September 6, 2017 Then you should continue with the steps, and install node/npm using yum or apt-get 1 Link to comment
TalatPlays Posted September 6, 2017 Author Share Posted September 6, 2017 alright ,thank's again Link to comment
keymetaphore Posted September 7, 2017 Share Posted September 7, 2017 14 hours ago, Moha|M| said: alright ,thank's again I hope you didn't type it in server console. You gotta type it in the terminal, as terminal would return something lol If you are using a hosting, ask your manager. 1 Link to comment
TalatPlays Posted September 7, 2017 Author Share Posted September 7, 2017 (edited) . 8 hours ago, Gourmet. said: I hope you didn't type it in server console. You gotta type it in the terminal, as terminal would return something lol If you are using a hosting, ask your manager. Damn ,whole this time i was typing it at server's Console ,such a noob me and my brain i spend alot of time for this . discord ! Thank you very much Edited September 7, 2017 by Moha|M| Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now