You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
611 B

  1. package main
  2. import (
  3. "bufio"
  4. "fmt"
  5. "os"
  6. "strings"
  7. )
  8. func optionManualTweetFromFlock(flock Flock) {
  9. fmt.Print("entry tweet content: ")
  10. newcommand := bufio.NewReader(os.Stdin)
  11. text, _ := newcommand.ReadString('\n')
  12. text = strings.TrimSpace(text)
  13. fmt.Print("tweet content: ")
  14. c.Purple(text)
  15. c.Red("Are you sure? [y/n]")
  16. newcommand = bufio.NewReader(os.Stdin)
  17. answer, _ := newcommand.ReadString('\n')
  18. answer = strings.TrimSpace(answer)
  19. switch answer {
  20. case "y":
  21. fmt.Println("ok, you are sure")
  22. tweetFromFlock(flock, text)
  23. break
  24. default:
  25. fmt.Println("Operation cancelled")
  26. break
  27. }
  28. }