func (d *DestroyCommand) Execute(args []string) error { config.Set("user", "") config.Set("token", "") utils.HandleInfo("You are now in `public` mode") return nil }
func (u *UserCommand) Execute(args []string) error { if config.Get("token") != "" { return &utils.ErrModes{} } if len(args) == 1 { config.Set("user", args[0]) utils.HandleInfo("You are now in `user` mode") } else { return &utils.ErrArgument{} } return nil }