Discord Bot with Server and Client communication

Post your Custom Scripts or Packages.

Moderator: POL Developer

Post Reply
Duttones
Apprentice Poster
Posts: 54
Joined: Tue Mar 27, 2012 8:56 pm

Discord Bot with Server and Client communication

Post by Duttones »

Hi Guys,
Just want to share with you'll my Discord Bot with both sides communication.
It uses auxservice to send messages to the Discord client, and to receive from the client.

The code is not fully commented, but it should be easy to use. The Bot Client was made using Node.JS, so you must install npm and node to run.

Instructions:
* Install NPM and Node;
* Run command "npm install" inside bot client folder.
* Edit the config.js file with your tokens, shard IP, etc.
* There is some particularity functions/methods from my shard, like who.getName(), you must update it.
* Get the archives from bash_from_POL_folder and put in pol folder. Give it permissions to run: chmod +x+u archivename
* Commands like !update and !poweron was made for POL running in a linux environment. You must update for .bat if you want to use with windows.
* start bot with node index.
* Edit auxsvc_control.src to include commands or remove.
* use start_script(":auxsvc:auxsvc_message", struct{ message := "my message" }); to send a message to General channel.
* use start_script(":auxsvc:auxsvc_message", struct{ key := "LogMessage", message := msg }); to send a message to Log Channel.

Cmd list:
Users
* !ping
* !who

Administrator (permission ADMINISTRATOR)
* !poweron - start POL
* !shutdown - Send command to shutdown POL
* !register acc pswd email
* !update - update shard scripts and output stderr and stdout to Discord
* !cpu - get machine cpu usage.
Attachments
auxsvc.zip
(2.96 KiB) Downloaded 275 times
discordBot-dist.zip
(27.5 KiB) Downloaded 280 times
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Discord Bot with Server and Client communication

Post by Harley »

Wow!
Duttones, really great work!
Duttones
Apprentice Poster
Posts: 54
Joined: Tue Mar 27, 2012 8:56 pm

Re: Discord Bot with Server and Client communication

Post by Duttones »

Thanks,
I made these commands to help the staff in charge of my shard to continue the development. Hope this helps the POL community too.

I can give assistance to anyone who needs here.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Discord Bot with Server and Client communication

Post by Yukiko »

Thank you Duttones.

Hmm... this looks vaguely familiar... I think I have seen a similar implementation somewhere. ;)
Post Reply