ens #32
@ -1476,9 +1476,9 @@ func (h *MenuHandlers) CheckBalance(ctx context.Context, sym string, input []byt
|
|||||||
if db.IsNotFound(err) {
|
if db.IsNotFound(err) {
|
||||||
balance := "0.00"
|
balance := "0.00"
|
||||||
if alias != "" {
|
if alias != "" {
|
||||||
content = l.Get("Alias: %s\nBalance: %s\n", alias, balance)
|
content = l.Get("%s balance: %s\n", alias, balance)
|
||||||
} else {
|
} else {
|
||||||
content = l.Get("Balance: %s\n", balance)
|
content = l.Get("balance: %s\n", balance)
|
||||||
}
|
}
|
||||||
res.Content = content
|
res.Content = content
|
||||||
return res, nil
|
return res, nil
|
||||||
@ -1505,9 +1505,9 @@ func (h *MenuHandlers) CheckBalance(ctx context.Context, sym string, input []byt
|
|||||||
balStr := fmt.Sprintf("%.2f %s", balFloat, activeSym)
|
balStr := fmt.Sprintf("%.2f %s", balFloat, activeSym)
|
||||||
|
|
||||||
if alias != "" {
|
if alias != "" {
|
||||||
|
|||||||
content = l.Get("Alias: %s\nBalance: %s\n", alias, balStr)
|
content = l.Get("%s balance: %s\n", alias, balStr)
|
||||||
} else {
|
} else {
|
||||||
content = l.Get("Balance: %s\n", balStr)
|
content = l.Get("balance: %s\n", balStr)
|
||||||
}
|
}
|
||||||
res.Content = content
|
res.Content = content
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user
DRY?
Commit:
e97d4be296
aims to resolve this. TheCheckBalance
should possibly be refactored further maybe? Currently it not only loads the balance,but also the user alias if set.