Gommeh
Veteran Member
dammit ryan and rylie
Posts: 2,744
| Likes: 778
|
Post by Gommeh on Jun 9, 2020 14:11:13 GMT
I set up DiscordSRV for GommehFreedom, and several op’s want to be able to do commands similar to our tf!list. How can I set this up and add commands?
|
|
fionn
Club 4000 Member
Admin Officer
elmon sucks
Posts: 6,157
| Likes: 4,775
|
Post by fionn on Jun 9, 2020 14:24:33 GMT
DiscordSRV and the Bot Commands are both separate; DiscordSRV only provides the chat stuff. The player list command sends a POST request to play.totalfreedom.me:28966/list?json=true & formats the list and outputs it to a discord embed. I believe Commands and ran using AMP's API, although there is a bot premade for this if you're using Pterodactyl
|
|
Gommeh
Veteran Member
dammit ryan and rylie
Posts: 2,744
| Likes: 778
|
Post by Gommeh on Jun 13, 2020 0:39:22 GMT
DiscordSRV and the Bot Commands are both separate; DiscordSRV only provides the chat stuff. The player list command sends a POST request to play.totalfreedom.me:28966/list?json=true & formats the list and outputs it to a discord embed. I believe Commands and ran using AMP's API, although there is a bot premade for this if you're using Pterodactyl OK, but how is tf!console set up so I can do in-game commands such as /gtfo from discord? Also, I find that my bot only responds to the first command that I made while my Terminal window is running after I input "node index.js". How can I get it so that it works all the time?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 13, 2020 1:41:18 GMT
DiscordSRV and the Bot Commands are both separate; DiscordSRV only provides the chat stuff. The player list command sends a POST request to play.totalfreedom.me:28966/list?json=true & formats the list and outputs it to a discord embed. I believe Commands and ran using AMP's API, although there is a bot premade for this if you're using Pterodactyl OK, but how is tf!console set up so I can do in-game commands such as /gtfo from discord? Also, I find that my bot only responds to the first command that I made while my Terminal window is running after I input "node index.js". How can I get it so that it works all the time? Again, since I have seen the source code for the TF bot (which is not being released), the tf!console command uses the AMP API. It’s also coded using python. The only command the TF bot does not use the AMP API for is tf!list, which said above, uses the HTTPD module for TFM.
|
|
XenVoltz
Veteran Member
Posts: 2,461
| Likes: 1,488
|
Post by XenVoltz on Jun 13, 2020 2:07:17 GMT
Also, I find that my bot only responds to the first command that I made while my Terminal window is running after I input "node index.js". How can I get it so that it works all the time? If by this you mean you want the bot still running, even when the terminal is closed, then you can't. You either host it on some sort of server like a VPS or a Dedicated Server, or you keep your computer on with the terminal open constantly.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 13, 2020 2:13:29 GMT
Also, I find that my bot only responds to the first command that I made while my Terminal window is running after I input "node index.js". How can I get it so that it works all the time? If by this you mean you want the bot still running, even when the terminal is closed, then you can't. You either host it on some sort of server like a VPS or a Dedicated Server, or you keep your computer on with the terminal open constantly. Either keep your computer running 24/7, or run it in a screen window on a VPS - that’s how TF’s bot is ran.
|
|
XenVoltz
Veteran Member
Posts: 2,461
| Likes: 1,488
|
Post by XenVoltz on Jun 13, 2020 2:41:50 GMT
Since you're using DiscordJS, I suggest using PM2 instead of a screen window (It's just easier to work with IMO and the guide covers it). The discord.js guide is really helpful and covers pretty much all the basic things you need to know.
|
|