Added!
There is now an toggle for this in the config.lua
There is now a new value for this in the config.json
I added a lang.json
to make it easy to translate the discord messages
zee
February 27, 2018, 9:26pm
23
Awesome update! Nice to see youâre taking suggestions from the community too.
Wow⌠you really are a legend!!!
Slluxx
March 1, 2018, 9:57am
25
not sure if someone told you already but you dont need to include the node_modules folder.
npm install
will install all modules and dependencies listed in the packages.json file.
also multiple server support would be nice
I know, but I wanted to make it more use friendly
But if this could cause any problems, tell me please and I will change it.
Do you mean multiple Discord or FX Server?
Slluxx
March 1, 2018, 2:41pm
27
fx
i removed ip and port from your json config and added an object of different servers for it
eg
"servers" : {
"mountains" : {
"ip": "",
"port" : ""
},
"tracks" : {
"ip": "",
"port" : ""
},
"default" : {
"ip": "",
"port" : ""
}
},
and to not mess too much with your code, i added a function
function returnServer(server) {
if (server == undefined || server == "") {
return message.channel.send("no server specified.")
}
var accessjson = "config.servers." + server
accessjson = eval(accessjson)
if (accessjson == null || accessjson == "" || accessjson == "{}" || accessjson.ip == undefined || accessjson.port == undefined){
message.channel.send("no server specified or wrong data")
return false
} else {
for (variable in accessjson) {
config[variable] = accessjson[variable]
}
return accessjson
}
}
far from perfect and just a quickly made code
but now i can just specify a server like !!kick <SERVER> [SERVER_ID] [REASON]
the function will get the data out of the servers object and make two new key:value in the first âlevelâ (config.ip, config.port)
at the end of the âclient.on(âmessageâ)â function, ill just delete the pair again with delete config.ip
Slluxx
March 1, 2018, 7:51pm
28
what i wish for the future
command limitations to one or more specific channels
multiple fx server support
kick and ban messages to be displayed in a bot-specific channel
EG: $user$ got kicked by $author$ \nReason: $reason$
i already did the first and second thing for myself but if you would include that - that would be much more clean. Also tried to do the last point and had some trouble because of the asynchronous nature of the code.
id like to see a little more clean code, a few more functions here and there to not rewite code all the time and stuff like that.
Noted! That may take some time, but I will try my bestâŚ
You probably already noticed, but that is my first script in Javascript
Still learning the basics
1 Like
Slluxx
March 1, 2018, 11:01pm
30
for your first script its very solid
1 Like
Your bot token is wrongâŚ
I cant find
DiscordToFiveM Bot Password
set DTF_Password âENTER_A_PASSWORD_HEREâ
Where is it at? What file?
Are you guys even reading or just posting dumb questions?
I mean, I WROTE WHAT TO DO!
Does it matter what line we put it in the .cfg file, should it be at top, bottom or does it not matter?
That doesnât really matter
Sounds good man, im trying to get the bot to work rn, its not going online! But thanks!
Got this bot working great, my only question is:
How can I set this up to auto start when the server starts? rather than having to manually start it every time
You could create a batch (Windows) / sh (linux) file and autostart it at system start.
Please use google for more information.