Chat commands

For discussion of the Poker Mavens server module and other administration topics

Chat commands

Postby social » Sun Dec 04, 2016 12:36 pm

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: 201
Joined: Fri Nov 20, 2009 12:23 am

Re: Chat commands

Postby social » Sun Dec 04, 2016 12:39 pm

I'm also looking for people who have the coding skills to do such a thing.
social
 
Posts: 201
Joined: Fri Nov 20, 2009 12:23 am

Re: Chat commands

Postby Kent Briggs » Sun Dec 04, 2016 1:24 pm

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).
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3831
Joined: Wed Mar 19, 2008 8:47 pm

Re: Chat commands

Postby social » Sun Dec 04, 2016 2:25 pm

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

Re: Chat commands

Postby harrythree » Sun Dec 04, 2016 3:59 pm

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

Re: Chat commands

Postby Kent Briggs » Sun Dec 04, 2016 5:38 pm

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
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3831
Joined: Wed Mar 19, 2008 8:47 pm


Return to Site Administration

Who is online

Users browsing this forum: No registered users and 10 guests

cron