Chat commands

For discussion of the Poker Mavens server module and other administration topics
Post Reply
social
Posts: 211
Joined: Fri Nov 20, 2009 12:23 am

Chat commands

Post 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?
social
Posts: 211
Joined: Fri Nov 20, 2009 12:23 am

Re: Chat commands

Post by social »

I'm also looking for people who have the coding skills to do such a thing.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Chat commands

Post 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).
social
Posts: 211
Joined: Fri Nov 20, 2009 12:23 am

Re: Chat commands

Post 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.
harrythree
Posts: 38
Joined: Sun Mar 01, 2015 4:20 pm

Re: Chat commands

Post 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
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Chat commands

Post 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/A ... m#callback
Post Reply