Sign in to follow this  
Moha|M|

Discord won't install in my server

Recommended Posts

Moha|M|    8

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

Share this post


Link to post
Moha|M|    8
7 hours ago, LopSided_ said:

@Moha|M| Still need help? What OS are you using?

Yes please ,i'm using Linux  64 bit .

Share this post


Link to post
LopSided_    60

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 :) 

  • Thanks 1

Share this post


Link to post
Moha|M|    8

Thank you very much , but when i type # node -v in console it shows nothing !

 

Edited by Moha|M|

Share this post


Link to post
Gourmet.    17
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.

  • Thanks 1

Share this post


Link to post
Moha|M|    8

.

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 :|

:o me and :o my brain i spend alot of time for this . :o discord !

Thank you very much

Edited by Moha|M|

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.