handle splitpot
This commit is contained in:
parent
a9710113d4
commit
82230c7dbf
|
@ -174,11 +174,13 @@ bot.on("message", async e => {
|
||||||
// end of game
|
// end of game
|
||||||
if(e.message.includes('wins the pot') || e.message.includes('Split pot')) {
|
if(e.message.includes('wins the pot') || e.message.includes('Split pot')) {
|
||||||
if(e.message.includes(e.self.me.nickname)) {
|
if(e.message.includes(e.self.me.nickname)) {
|
||||||
const amount = +e.message.match(/size (\d+) /)[1];
|
if(e.message.includes('Split pot')) {
|
||||||
if(e.message.includes('Split pot'))
|
const tmp = e.message.match(/size (\d+) .*: (.*) \(/);
|
||||||
env.bank += ~~(amount / 2);
|
env.bank += ~~(tmp[1] / tmp[2].split(', ').length);
|
||||||
else
|
}
|
||||||
env.bank += amount;
|
else {
|
||||||
|
env.bank += +e.message.match(/pot(: | of size )(\d+)/)[2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
env.gamestate = 'preflop';
|
env.gamestate = 'preflop';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user