mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Add version system, tax tracking, lottery winner DMs, fmtEuro, audit fixes
- Version system: per-plugin versions via Versioned interface, crash_log and version_history DB tables, !version command, crash stats in !botinfo - Tax tracking: tax_ledger table, trackTaxPaid across all communityTax and communityPotAdd sites, tax paid display in !stats and !superstatsexplusalpha - Lottery: DM winners with winning ticket details and matched numbers bolded - fmtEuro: generic currency formatter with thousand separators across all economy display paths - Audit fixes: streak_decayed column for Streak Survivor achievement, combat_narrative empty-phase guard, crafting success rate integer division, RecordCrash nil-DB guard Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -411,7 +411,8 @@ func NewUnoPlugin(client *mautrix.Client, euro *EuroPlugin) *UnoPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *UnoPlugin) Name() string { return "uno" }
|
||||
func (p *UnoPlugin) Name() string { return "uno" }
|
||||
func (p *UnoPlugin) Version() string { return "1.2.0" }
|
||||
|
||||
func (p *UnoPlugin) Commands() []CommandDef {
|
||||
return []CommandDef{
|
||||
@@ -1689,7 +1690,8 @@ func (p *UnoPlugin) suddenDeathWinner(game *unoGame) {
|
||||
if playerWins {
|
||||
payout := p.claimFromPot(game.wager)
|
||||
totalPayout := game.wager + payout
|
||||
p.euro.Credit(game.playerID, totalPayout, "uno_win")
|
||||
net, _ := communityTax(game.playerID, totalPayout, 0.05)
|
||||
p.euro.Credit(game.playerID, net, "uno_win")
|
||||
|
||||
newPot := p.getPot()
|
||||
p.SendMessage(game.dmRoomID, "🎉 **You win on points!**")
|
||||
@@ -1885,7 +1887,8 @@ func (p *UnoPlugin) playerWins(game *unoGame) error {
|
||||
potBefore := p.getPot()
|
||||
payout := p.claimFromPot(game.wager)
|
||||
totalPayout := game.wager + payout
|
||||
p.euro.Credit(game.playerID, totalPayout, "uno_win")
|
||||
net, _ := communityTax(game.playerID, totalPayout, 0.05)
|
||||
p.euro.Credit(game.playerID, net, "uno_win")
|
||||
|
||||
newPot := p.getPot()
|
||||
playerName := p.DisplayName(game.playerID)
|
||||
|
||||
Reference in New Issue
Block a user