mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
interact: use RemoveKeyboard from interact.KeyboardController
This commit is contained in:
parent
ef84742eb7
commit
7b572120a1
|
@ -92,12 +92,15 @@ func (m *PositionInteraction) Commands(i *interact.Interact) {
|
||||||
case "yes":
|
case "yes":
|
||||||
m.closePositionTask.confirmed = true
|
m.closePositionTask.confirmed = true
|
||||||
reply.Message(fmt.Sprintf("Your %s position is closed", m.closePositionTask.symbol))
|
reply.Message(fmt.Sprintf("Your %s position is closed", m.closePositionTask.symbol))
|
||||||
reply.RemoveKeyboard()
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// call position close
|
// call position close
|
||||||
|
if kc, ok := reply.(interact.KeyboardController); ok {
|
||||||
|
kc.RemoveKeyboard()
|
||||||
|
}
|
||||||
|
|
||||||
// reply result
|
// reply result
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -127,7 +127,10 @@ func (it *CoreInteraction) Commands(i *interact.Interact) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reply.RemoveKeyboard()
|
if kc, ok := reply.(interact.KeyboardController) ; ok {
|
||||||
|
kc.RemoveKeyboard()
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -172,7 +175,9 @@ func (it *CoreInteraction) Commands(i *interact.Interact) {
|
||||||
|
|
||||||
if position.Base == 0 {
|
if position.Base == 0 {
|
||||||
reply.Message("No opened position")
|
reply.Message("No opened position")
|
||||||
reply.RemoveKeyboard()
|
if kc, ok := reply.(interact.KeyboardController) ; ok {
|
||||||
|
kc.RemoveKeyboard()
|
||||||
|
}
|
||||||
return fmt.Errorf("no opened position")
|
return fmt.Errorf("no opened position")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,7 +196,9 @@ func (it *CoreInteraction) Commands(i *interact.Interact) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
reply.RemoveKeyboard()
|
if kc, ok := reply.(interact.KeyboardController) ; ok {
|
||||||
|
kc.RemoveKeyboard()
|
||||||
|
}
|
||||||
|
|
||||||
err = it.closePositionContext.closer.ClosePosition(context.Background(), percentage)
|
err = it.closePositionContext.closer.ClosePosition(context.Background(), percentage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -41,9 +41,6 @@ type Reply interface {
|
||||||
// Choose(prompt string, options ...Option)
|
// Choose(prompt string, options ...Option)
|
||||||
// Confirm shows the confirm dialog or confirm button in the user interface
|
// Confirm shows the confirm dialog or confirm button in the user interface
|
||||||
// Confirm(prompt string)
|
// Confirm(prompt string)
|
||||||
|
|
||||||
// RemoveKeyboard hides the keyboard from the client user interface
|
|
||||||
RemoveKeyboard()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeyboardController is used when messenger supports keyboard controls
|
// KeyboardController is used when messenger supports keyboard controls
|
||||||
|
|
Loading…
Reference in New Issue
Block a user