Page 1 of 1

Chat commands

PostPosted: Sun Dec 04, 2016 12:36 pm
by social
I'd like to build a Bot using the Chat function.
Similar to the Bots for various Chat apps, not specifically for playing Poker.

Is there any function which listens to and/or records what is said in the Chat Box
which I could use for scanning for Keywords and subsequent text/commands?

Re: Chat commands

PostPosted: Sun Dec 04, 2016 12:39 pm
by social
I'm also looking for people who have the coding skills to do such a thing.

Re: Chat commands

PostPosted: Sun Dec 04, 2016 1:24 pm
by Kent Briggs
social wrote:Is there any function which listens to and/or records what is said in the Chat Box
which I could use for scanning for Keywords and subsequent text/commands?


There is for the Lobby chat. See "Lobby chat event" and "Lobby chat event regex" in the Callback Events group on the System tab. That system was designed so that players could enter custom commands such as staking other players, getting bitcoin prices, etc. (all coded by the site operator).

Re: Chat commands

PostPosted: Sun Dec 04, 2016 2:25 pm
by social
Kent Briggs wrote:
social wrote:Is there any function which listens to and/or records what is said in the Chat Box
which I could use for scanning for Keywords and subsequent text/commands?


There is for the Lobby chat. See "Lobby chat event" and "Lobby chat event regex" in the Callback Events group on the System tab. That system was designed so that players could enter custom commands such as staking other players, getting bitcoin prices, etc. (all coded by the site operator).


OK, I read the section on callbacks: http://prntscr.com/dfbc5g

This will send commands to *my* server when certain phrases are triggered.

However, I don't understand how to get my server's replies to those callbacks into the Poker Mavens chat, or the client in general.

Re: Chat commands

PostPosted: Sun Dec 04, 2016 3:59 pm
by harrythree
You can have an Admin message triggered via the API with something SystemLobbyMessage, RingGamesMessage and TournamentsMessage. So when the callback happens on your server, it would send the reply via one/all of these messages back to the client and they would show up in chat

Re: Chat commands

PostPosted: Sun Dec 04, 2016 5:38 pm
by Kent Briggs
social wrote:However, I don't understand how to get my server's replies to those callbacks into the Poker Mavens chat, or the client in general.


harrythree has it correct. The callback will execute your code (typically a PHP script on your own web site), and pass in the parameters of the chat just entered. Your code will process that however you want. If you then want to send a message back to the players, your script would make the applicable API call. Such as SystemLobbyMessage which will put a message right in the Lobby chat. You can see some sample callback code on the API Examples page:

http://www.briggsoft.com/docs/pmavens/API_Examples.htm#callback