Documentation ¶
Overview ¶
Package say contains SayCmd which returns a random sentence using hitokoto api.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SayCmd = &cobra.Command{ Use: "say", Short: "Say something(# ̄▽ ̄#)", Long: "Hi Jarvis, say something please(# ̄▽ ̄#)", Run: func(cmd *cobra.Command, args []string) { s := spinner.New(spinner.CharSets[9], 100*time.Millisecond) s.Start() res, err := http.Get("https://v1.hitokoto.cn/?encode=text") s.Stop() utils.ExitOnError(err) defer res.Body.Close() contents, err := ioutil.ReadAll(res.Body) utils.ExitOnError(err) fmt.Printf("%s\n", string(contents)) }, }
SayCmd returns a random sentence using hitokoto api.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.